diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-21 16:07:59 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-21 16:07:59 -0600 |
commit | f71be2506dea09ce405e8f961fb1e2290c168f3f (patch) | |
tree | 1d074db706442462c5565c02fd88e263b501a717 | |
parent | 118682ce5cd8492ecc554c1356567d7b6628c01e (diff) | |
download | craftbukkit-f71be2506dea09ce405e8f961fb1e2290c168f3f.tar craftbukkit-f71be2506dea09ce405e8f961fb1e2290c168f3f.tar.gz craftbukkit-f71be2506dea09ce405e8f961fb1e2290c168f3f.tar.lz craftbukkit-f71be2506dea09ce405e8f961fb1e2290c168f3f.tar.xz craftbukkit-f71be2506dea09ce405e8f961fb1e2290c168f3f.zip |
Fix loading Items entities with an invalid item. Addresses BUKKIT-3249
-rw-r--r-- | src/main/java/net/minecraft/server/EntityItem.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index 0b139a62..1cb66dfe 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -195,7 +195,18 @@ public class EntityItem extends Entity { this.age = nbttagcompound.getShort("Age"); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item"); - this.setItemStack(ItemStack.a(nbttagcompound1)); + // CraftBukkit start + if (nbttagcompound1 != null) { + ItemStack itemstack = ItemStack.a(nbttagcompound1); + if (itemstack != null) { + this.setItemStack(itemstack); + } else { + this.die(); + } + } else { + this.die(); + } + // CraftBukkit end if (this.getItemStack() == null) { this.die(); } |