diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-03-13 22:28:27 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-15 22:26:27 -0400 |
commit | 66e067f37335ddb6261487744c42e4efc709d2b9 (patch) | |
tree | 5a9cf115c0480fa10afb0eb2d772271e43d35acd | |
parent | 83265005f6c38256c762a55e62b21ce67fa278cc (diff) | |
download | craftbukkit-66e067f37335ddb6261487744c42e4efc709d2b9.tar craftbukkit-66e067f37335ddb6261487744c42e4efc709d2b9.tar.gz craftbukkit-66e067f37335ddb6261487744c42e4efc709d2b9.tar.lz craftbukkit-66e067f37335ddb6261487744c42e4efc709d2b9.tar.xz craftbukkit-66e067f37335ddb6261487744c42e4efc709d2b9.zip |
[Bleeding] Make InventoryView.setItem(-999, item) drop the item on the ground by default.
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java | 6 |
1 files 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 daa6e313..95eb6163 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); } } |