From 93732e21bc1b6de00438f2b42aaeb8251ad5fc71 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 13 Mar 2012 21:46:00 -0400 Subject: [PATCH] [Bleeding] Fixed NullPointerException in InventoryView.setCursor() if you tried to empty the cursor by setting it to null. Fixes BUKKIT-1043 --- .../java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 41fde2edba..e7beb2e6d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -68,8 +68,8 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } public void setItemOnCursor(ItemStack item) { - CraftItemStack stack = new CraftItemStack(item); - getHandle().inventory.setCarried(stack.getHandle()); + net.minecraft.server.ItemStack stack = CraftItemStack.createNMSItemStack(item); + getHandle().inventory.setCarried(stack); if (this instanceof CraftPlayer) { ((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor }