summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2012-01-27 19:42:04 +0100
committerErik Broes <erikbroes@grum.nl>2012-01-27 19:42:14 +0100
commit38ad0ea5fd78404490ba52c7be2241f7b4036dec (patch)
treed8d8cf5ea8df40703c7f6d927ee42854aa30b3b5
parent16d3b705c5d6643a4269f0c9d49a0745426753d4 (diff)
downloadcraftbukkit-38ad0ea5fd78404490ba52c7be2241f7b4036dec.tar
craftbukkit-38ad0ea5fd78404490ba52c7be2241f7b4036dec.tar.gz
craftbukkit-38ad0ea5fd78404490ba52c7be2241f7b4036dec.tar.lz
craftbukkit-38ad0ea5fd78404490ba52c7be2241f7b4036dec.tar.xz
craftbukkit-38ad0ea5fd78404490ba52c7be2241f7b4036dec.zip
Prevent (Entity) null to be added to the entity list.
-rw-r--r--src/main/java/net/minecraft/server/World.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3dfe7661..a0d0fc91 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -866,6 +866,8 @@ public class World implements IBlockAccess {
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
// CraftBukkit end
+ if (entity == null) return false;
+
int i = MathHelper.floor(entity.locX / 16.0D);
int j = MathHelper.floor(entity.locZ / 16.0D);
boolean flag = false;