2015-01-12 00:38:47 +00:00
|
|
|
From ff00b8a9c49a289d0cac4c8fb4119e61c2fd140b Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +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-12-18 23:33:08 +00:00
|
|
|
index 7eb41e1..b65c225 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
2014-12-07 19:26:30 +00:00
|
|
|
@@ -427,6 +427,7 @@ public abstract class EntityHuman extends EntityLiving {
|
2014-07-21 20:46:54 +00:00
|
|
|
|
|
|
|
List list = this.world.getEntities(this, axisalignedbb);
|
|
|
|
|
2014-11-28 01:17:45 +00:00
|
|
|
+ if (this.ae()) { // Spigot: Add this.ae() condition (second !this.isDead near bottom of EntityLiving)
|
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity = (Entity) list.get(i);
|
2014-07-21 20:46:54 +00:00
|
|
|
|
2014-12-07 19:26:30 +00:00
|
|
|
@@ -434,6 +435,7 @@ public abstract class EntityHuman extends EntityLiving {
|
2014-11-28 01:17:45 +00:00
|
|
|
this.d(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ } // Spigot
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2014-07-21 20:46:54 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2015-01-12 00:38:47 +00:00
|
|
|
index fc8517d..b231ee2 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2015-01-12 00:38:47 +00:00
|
|
|
@@ -1626,7 +1626,7 @@ public abstract class EntityLiving extends Entity {
|
2014-11-28 01:17:45 +00:00
|
|
|
protected void bK() {
|
|
|
|
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
2014-07-21 20:46:54 +00:00
|
|
|
|
|
|
|
- if (list != null && !list.isEmpty()) {
|
2014-11-28 01:17:45 +00:00
|
|
|
+ if (this.ad() && list != null && !list.isEmpty()) { // Spigot: Add this.ad() condition
|
2014-07-21 20:46:54 +00:00
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity = (Entity) list.get(i);
|
2014-11-28 01:17:45 +00:00
|
|
|
|
2014-07-21 20:46:54 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2015-01-12 00:38:47 +00:00
|
|
|
index ce54ae8..b957470 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -62,6 +62,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
2014-07-21 20:46:54 +00:00
|
|
|
public double maxHealthCache;
|
|
|
|
public boolean joining = true;
|
|
|
|
// CraftBukkit end
|
|
|
|
+ // Spigot start
|
|
|
|
+ public boolean collidesWithEntities = true;
|
|
|
|
+
|
|
|
|
+ @Override
|
2014-11-28 01:17:45 +00:00
|
|
|
+ public boolean ad()
|
2014-07-21 20:46:54 +00:00
|
|
|
+ {
|
2014-11-28 01:17:45 +00:00
|
|
|
+ return this.collidesWithEntities && super.ad(); // (first !this.isDead near bottom of EntityLiving)
|
2014-07-21 20:46:54 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
2014-11-28 01:17:45 +00:00
|
|
|
+ public boolean ae()
|
2014-07-21 20:46:54 +00:00
|
|
|
+ {
|
2014-11-28 01:17:45 +00:00
|
|
|
+ return this.collidesWithEntities && super.ae(); // (second !this.isDead near bottom of EntityLiving)
|
2014-07-21 20:46:54 +00:00
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
|
|
|
|
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
|
|
|
|
super(worldserver, gameprofile);
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2014-12-18 23:33:08 +00:00
|
|
|
index 9268686..dfef8cb 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2014-12-18 23:33:08 +00:00
|
|
|
@@ -1318,6 +1318,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2014-07-21 20:46:54 +00:00
|
|
|
// Spigot start
|
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|
|
|
|
{
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean getCollidesWithEntities()
|
|
|
|
+ {
|
|
|
|
+ return getHandle().collidesWithEntities;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCollidesWithEntities(boolean collides)
|
|
|
|
+ {
|
|
|
|
+ getHandle().collidesWithEntities = collides;
|
|
|
|
+ getHandle().k = collides; // First boolean of Entity
|
|
|
|
+ }
|
|
|
|
};
|
|
|
|
|
|
|
|
public Player.Spigot spigot()
|
|
|
|
--
|
2014-11-28 01:17:45 +00:00
|
|
|
2.1.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|