2014-03-26 20:34:47 +00:00
|
|
|
From 46c4c10732506e3dfdff3bdc7303210050a0a003 Mon Sep 17 00:00:00 2001
|
2013-08-03 09:27:26 +00:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Sat, 3 Aug 2013 19:27:07 +1000
|
|
|
|
Subject: [PATCH] Player Collision API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
2014-03-26 20:34:47 +00:00
|
|
|
index eaf823c..a0f4dfc 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
2013-12-01 03:40:53 +00:00
|
|
|
@@ -430,7 +430,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
2013-08-03 09:27:26 +00:00
|
|
|
|
|
|
|
List list = this.world.getEntities(this, axisalignedbb);
|
|
|
|
|
|
|
|
- if (list != null) {
|
2013-12-01 06:12:38 +00:00
|
|
|
+ if (list != null && this.R()) { // Spigot: Add this.R() condition
|
2013-08-03 09:27:26 +00:00
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity = (Entity) list.get(i);
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2014-03-26 20:34:47 +00:00
|
|
|
index 3758411..90c0e82 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2014-03-23 00:06:43 +00:00
|
|
|
@@ -1490,7 +1490,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
protected void bn() {
|
2013-08-03 09:27:26 +00:00
|
|
|
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
|
|
|
|
|
|
|
- if (list != null && !list.isEmpty()) {
|
2013-12-01 06:12:38 +00:00
|
|
|
+ if (this.R() && list != null && !list.isEmpty()) { // Spigot: Add this.R() condition
|
2013-08-03 09:27:26 +00:00
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity = (Entity) list.get(i);
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2014-03-26 20:34:47 +00:00
|
|
|
index 8d98a70..d32a2d2 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2014-03-26 20:34:47 +00:00
|
|
|
@@ -63,6 +63,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|
|
|
public double maxHealthCache;
|
2014-03-23 04:21:51 +00:00
|
|
|
public boolean joining = true;
|
2013-08-03 09:27:26 +00:00
|
|
|
// CraftBukkit end
|
|
|
|
+ // Spigot start
|
|
|
|
+ public boolean collidesWithEntities = true;
|
|
|
|
+
|
|
|
|
+ @Override
|
2014-03-23 18:16:32 +00:00
|
|
|
+ public boolean Q()
|
|
|
|
+ {
|
|
|
|
+ return this.collidesWithEntities && super.Q();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
2013-12-01 06:12:38 +00:00
|
|
|
+ public boolean R()
|
2013-08-03 09:27:26 +00:00
|
|
|
+ {
|
2013-12-01 06:12:38 +00:00
|
|
|
+ return this.collidesWithEntities && super.R();
|
2013-08-03 09:27:26 +00:00
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
|
2013-12-01 03:40:53 +00:00
|
|
|
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
|
|
|
|
super(worldserver, gameprofile);
|
2013-08-03 09:27:26 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2014-03-26 20:34:47 +00:00
|
|
|
index b03037a..d251e79 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2014-02-12 13:48:26 +00:00
|
|
|
@@ -1257,6 +1257,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2013-12-01 03:40:53 +00:00
|
|
|
// Spigot start
|
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|
|
|
|
{
|
2013-08-03 09:35:01 +00:00
|
|
|
+
|
2013-08-03 09:27:26 +00:00
|
|
|
+ @Override
|
|
|
|
+ public boolean getCollidesWithEntities()
|
|
|
|
+ {
|
|
|
|
+ return getHandle().collidesWithEntities;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCollidesWithEntities(boolean collides)
|
|
|
|
+ {
|
|
|
|
+ getHandle().collidesWithEntities = collides;
|
2014-03-23 00:06:43 +00:00
|
|
|
+ getHandle().k = collides; // First boolean of Entity
|
2013-08-03 09:27:26 +00:00
|
|
|
+ }
|
|
|
|
};
|
|
|
|
|
2013-08-03 09:59:46 +00:00
|
|
|
public Player.Spigot spigot()
|
2013-08-03 09:27:26 +00:00
|
|
|
--
|
2014-03-23 18:16:32 +00:00
|
|
|
1.8.5.2.msysgit.0
|
2013-08-03 09:27:26 +00:00
|
|
|
|