summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-12-21 15:07:02 -0600
committerfeildmaster <admin@feildmaster.com>2012-12-21 15:40:27 -0600
commite937307596f9ec6b562df1c3b89968fe51143813 (patch)
tree5ae0ec1db6218a96ad7a1e7219b50eff43568e50 /src/main/java/net/minecraft/server
parentb870755edb3d17c3609b9c7d53c084d920e47fa2 (diff)
downloadcraftbukkit-e937307596f9ec6b562df1c3b89968fe51143813.tar
craftbukkit-e937307596f9ec6b562df1c3b89968fe51143813.tar.gz
craftbukkit-e937307596f9ec6b562df1c3b89968fe51143813.tar.lz
craftbukkit-e937307596f9ec6b562df1c3b89968fe51143813.tar.xz
craftbukkit-e937307596f9ec6b562df1c3b89968fe51143813.zip
Add a null check for Item Entities. Fixes BUKKIT-3249
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/EntityItem.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index c8776867..0b139a62 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -28,6 +28,11 @@ public class EntityItem extends Entity {
public EntityItem(World world, double d0, double d1, double d2, ItemStack itemstack) {
this(world, d0, d1, d2);
+ // CraftBukkit start - Can't set null items in the datawatcher
+ if (itemstack == null || itemstack.getItem() == null) {
+ return;
+ }
+ // CraftBukkit end
this.setItemStack(itemstack);
}