From 5b930cdc3b99fdc1fa6a4d05334f674374767eef Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 15 Mar 2012 20:48:41 +1100 Subject: [PATCH] Restore [free] and [disposal] signs back to their intended behaviour --- .../com/earth2me/essentials/signs/SignDisposal.java | 5 +---- .../src/com/earth2me/essentials/signs/SignFree.java | 11 +++-------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java index aa6376fa0..f44c6177a 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java @@ -14,10 +14,7 @@ public class SignDisposal extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { - player.sendMessage("Bukkit broke this sign :("); - //TODO: wait for a fix in bukkit - //Problem: Items can be duplicated - //player.getBase().openInventory(ess.getServer().createInventory(player, 36)); + player.getBase().openInventory(ess.getServer().createInventory(player, 36)); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index f5f32c38c..c7adec307 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -35,14 +35,9 @@ public class SignFree extends EssentialsSign } item.setAmount(item.getType().getMaxStackSize()); - InventoryWorkaround.addItem(player.getInventory(), true, item); - player.sendMessage("Item added to your inventory."); - player.updateInventory(); - //TODO: wait for a fix in bukkit - //Problem: Items can be duplicated - //Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST); - //i.addItem(item); - //player.openInventory(i); + Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST); + i.addItem(item); + player.openInventory(i); Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); return true; }