Make setting slots to AIR set them to null. Addresses BUKKIT-1043

This commit is contained in:
EvilSeph 2012-03-10 15:54:10 -05:00
parent 68c89fcac9
commit f534863552

View File

@ -69,7 +69,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
public void setItemOnCursor(ItemStack item) { public void setItemOnCursor(ItemStack item) {
CraftItemStack stack = new CraftItemStack(item.getType(), item.getAmount(), item.getDurability()); 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) { if (this instanceof CraftPlayer) {
((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor ((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor
} }