From 66e067f37335ddb6261487744c42e4efc709d2b9 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 13 Mar 2012 22:28:27 -0400 Subject: [PATCH] [Bleeding] Make InventoryView.setItem(-999, item) drop the item on the ground by default. --- .../bukkit/craftbukkit/inventory/CraftInventoryView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java index daa6e313d2..95eb616381 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java @@ -49,9 +49,11 @@ public class CraftInventoryView extends InventoryView { @Override public void setItem(int slot, ItemStack item) { + net.minecraft.server.ItemStack stack = CraftItemStack.createNMSItemStack(item); if (slot != -999) { - CraftItemStack stack = new CraftItemStack(item); - container.getSlot(slot).set(stack.getHandle()); + container.getSlot(slot).set(stack); + } else { + player.getHandle().drop(stack); } }