diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-06-25 03:24:53 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-06-28 19:34:31 -0500 |
commit | a21f038fc335c6d9e77290e613937c234d0a15a1 (patch) | |
tree | 5dcf78884230e56f9a9d4f28bd7138d0365d9176 /src/main/java | |
parent | f5b6abfae1377905e6fc2c46e36dfe2279c48b2b (diff) | |
download | craftbukkit-a21f038fc335c6d9e77290e613937c234d0a15a1.tar craftbukkit-a21f038fc335c6d9e77290e613937c234d0a15a1.tar.gz craftbukkit-a21f038fc335c6d9e77290e613937c234d0a15a1.tar.lz craftbukkit-a21f038fc335c6d9e77290e613937c234d0a15a1.tar.xz craftbukkit-a21f038fc335c6d9e77290e613937c234d0a15a1.zip |
Mark entities as invalid when they get despawned. Addresses BUKKIT-810
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/Entity.java | 1 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/World.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java | 4 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 4c5758b8..144dc63c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -143,6 +143,7 @@ public abstract class Entity { public boolean cd; public boolean ce; public UUID uniqueId = UUID.randomUUID(); // CraftBukkit + public boolean valid = true; // CraftBukkit public Entity(World world) { this.id = entityCount++; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index dc8a5f71..589c9320 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -929,6 +929,8 @@ public class World implements IBlockAccess { for (int i = 0; i < this.u.size(); ++i) { ((IWorldAccess) this.u.get(i)).b(entity); } + + entity.valid = false; // CraftBukkit } public void kill(Entity entity) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index a6d9c377..9ab1e669 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -212,6 +212,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return !entity.isAlive(); } + public boolean isValid() { + return entity.isAlive() && entity.valid; + } + public Server getServer() { return server; } |