summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignFree.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java
index 46c5a0f6e..55ea1d241 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java
@@ -1,6 +1,8 @@
package com.earth2me.essentials.signs;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.InventoryWorkaround;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import net.minecraft.server.InventoryPlayer;
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
@@ -17,18 +19,20 @@ public class SignFree extends EssentialsSign
@Override
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
{
- getItemStack(sign.getLine(1), 9 * 4 * 64, ess);
+ getItemStack(sign.getLine(1), 1, ess);
return true;
}
@Override
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
{
- final ItemStack item = getItemStack(sign.getLine(1), 9 * 4 * 64, ess);
+ final ItemStack item = getItemStack(sign.getLine(1), 1, ess);
+ item.setAmount(item.getType().getMaxStackSize()*9*4);
final CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(player.getHandle()));
inv.clear();
- inv.addItem(item);
+ InventoryWorkaround.addItem(inv, true, item);
player.showInventory(inv);
+ Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), ess);
return true;
}
}