diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-03-13 22:28:07 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-15 22:24:23 -0400 |
commit | 09eacb968d929d0057fbefae3de9b5fe15376ba1 (patch) | |
tree | ca962d291d831f4a15486c3f5a415b61a6da5257 | |
parent | f528e62a84f859315a3fe79a245386c4ae578270 (diff) | |
download | bukkit-09eacb968d929d0057fbefae3de9b5fe15376ba1.tar bukkit-09eacb968d929d0057fbefae3de9b5fe15376ba1.tar.gz bukkit-09eacb968d929d0057fbefae3de9b5fe15376ba1.tar.lz bukkit-09eacb968d929d0057fbefae3de9b5fe15376ba1.tar.xz bukkit-09eacb968d929d0057fbefae3de9b5fe15376ba1.zip |
[Bleeding] Make InventoryView.setItem(-999, item) drop the item on the ground by default.
-rw-r--r-- | src/main/java/org/bukkit/inventory/InventoryView.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java index fd2c4080..84e189ed 100644 --- a/src/main/java/org/bukkit/inventory/InventoryView.java +++ b/src/main/java/org/bukkit/inventory/InventoryView.java @@ -88,6 +88,9 @@ public abstract class InventoryView { /** * Sets one item in this inventory view by its raw slot ID. + * <p> + * Note: If slot ID -999 is chosen, it may be expected that the item is + * dropped on the ground. This is not required behaviour, however. * @param slot The ID as returned by InventoryClickEvent.getRawSlot() * @param item The new item to put in the slot, or null to clear it. */ @@ -98,6 +101,8 @@ public abstract class InventoryView { } else { getBottomInventory().setItem(convertSlot(slot),item); } + } else { + getPlayer().getWorld().dropItemNaturally(getPlayer().getLocation(), item); } } |