diff options
author | EvilSeph <evilseph@gmail.com> | 2012-01-20 11:45:37 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-01-20 11:46:24 -0500 |
commit | 1bbeec1f75cfe4273d3782617ed04b7586b17c72 (patch) | |
tree | 0b083284885b2334d5bd8c3175112dcc7f1b91ca /src | |
parent | 85ab95cec7abc5cb39dbb94c169bd0ae3a9b2fef (diff) | |
download | craftbukkit-1bbeec1f75cfe4273d3782617ed04b7586b17c72.tar craftbukkit-1bbeec1f75cfe4273d3782617ed04b7586b17c72.tar.gz craftbukkit-1bbeec1f75cfe4273d3782617ed04b7586b17c72.tar.lz craftbukkit-1bbeec1f75cfe4273d3782617ed04b7586b17c72.tar.xz craftbukkit-1bbeec1f75cfe4273d3782617ed04b7586b17c72.zip |
Accounted for NMS getItem() returning null in recent commit.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityTrackerEntry.java | 1 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java index 0a2a76dd..a43ae1f9 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -241,6 +241,7 @@ public class EntityTrackerEntry { if (this.tracker instanceof EntityItem) { EntityItem entityitem = (EntityItem) this.tracker; + if (entityitem.dead|| entityitem.itemStack == null) return null; // CraftBukkit Packet21PickupSpawn packet21pickupspawn = new Packet21PickupSpawn(entityitem); entityitem.locX = (double) packet21pickupspawn.b / 32.0D; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index b5391b35..d4e62a2b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -27,7 +27,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory { } public ItemStack getItem(int index) { - return getInventory().getItem(index).id == 0 ? null : new CraftItemStack(getInventory().getItem(index)); + return (getInventory().getItem(index) == null || getInventory().getItem(index).id == 0) ? null : new CraftItemStack(getInventory().getItem(index)); } public ItemStack[] getContents() { |