diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-23 20:15:03 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-23 20:15:03 +0000 |
commit | dddf529ff5fcd5f11df24b2b945fdf0d4534b266 (patch) | |
tree | eeeb4bb52aeb54382c08fc42d8564fa2cf49ec68 | |
parent | b3de0aabae8c8c1ca428e9c1f44edb3b7519ed11 (diff) | |
download | Essentials-dddf529ff5fcd5f11df24b2b945fdf0d4534b266.tar Essentials-dddf529ff5fcd5f11df24b2b945fdf0d4534b266.tar.gz Essentials-dddf529ff5fcd5f11df24b2b945fdf0d4534b266.tar.lz Essentials-dddf529ff5fcd5f11df24b2b945fdf0d4534b266.tar.xz Essentials-dddf529ff5fcd5f11df24b2b945fdf0d4534b266.zip |
Make sure items don't stack wrong in [free] signs.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/signs/SignFree.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 52e2b9540..24ce481ff 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -34,10 +34,12 @@ public class SignFree extends EssentialsSign throw new SignException(_("cantSpawnItem", "Air")); } - item.setAmount(item.getType().getMaxStackSize() * 36); - Inventory i = ess.getServer().createInventory(player, 36); - i.addItem(item); - player.openInventory(i); + item.setAmount(item.getType().getMaxStackSize()); + Inventory invent = ess.getServer().createInventory(player, 36); + for (int i = 0; i < 36; i++) { + invent.addItem(item); + } + player.openInventory(invent); Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); return true; } |