From f5348635522112c32793ebc2391985bf7031e8e0 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Sat, 10 Mar 2012 15:54:10 -0500 Subject: [PATCH] Make setting slots to AIR set them to null. Addresses BUKKIT-1043 --- .../java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 10e06b83cb..3d1f27e3df 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -69,7 +69,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { public void setItemOnCursor(ItemStack item) { CraftItemStack stack = new CraftItemStack(item.getType(), item.getAmount(), item.getDurability()); - getHandle().inventory.setCarried(stack.getHandle()); + getHandle().inventory.setCarried(stack.getType() == Material.AIR ? null : stack.getHandle()); if (this instanceof CraftPlayer) { ((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor }