diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/signs/SignFree.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 8939f4bea..8a7c27fe7 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -4,7 +4,9 @@ import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.InventoryWorkaround; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import net.minecraft.server.InventoryPlayer; +import org.bukkit.Material; import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer; import org.bukkit.inventory.ItemStack; @@ -27,6 +29,11 @@ public class SignFree extends EssentialsSign protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException { final ItemStack item = getItemStack(sign.getLine(1), 1, ess); + if (item.getType() == Material.AIR) + { + throw new SignException(Util.format("cantSpawnItem", "Air")); + } + item.setAmount(item.getType().getMaxStackSize()*9*4); final CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(player.getHandle())); inv.clear(); |