diff options
author | GunfighterJ <joseph.jenniges@gmail.com> | 2013-09-17 06:29:03 -0500 |
---|---|---|
committer | Chris Ward <chris@chrisgward.com> | 2013-09-17 23:23:45 +1000 |
commit | 503d39ee55ec7f2f293b5d029f53600c8df97999 (patch) | |
tree | ff10e0c0523ba0166a67763e09a5fd405eb1aba2 /Essentials/src/com/earth2me/essentials/signs/SignTrade.java | |
parent | bd5fd2980f63abeecb0e73bfa2d5874e5603273e (diff) | |
download | Essentials-503d39ee55ec7f2f293b5d029f53600c8df97999.tar Essentials-503d39ee55ec7f2f293b5d029f53600c8df97999.tar.gz Essentials-503d39ee55ec7f2f293b5d029f53600c8df97999.tar.lz Essentials-503d39ee55ec7f2f293b5d029f53600c8df97999.tar.xz Essentials-503d39ee55ec7f2f293b5d029f53600c8df97999.zip |
Update ItemStack reference to getTypeId()stable-2.12.1
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/signs/SignTrade.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/signs/SignTrade.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java index 352f72299..05b488d29 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java @@ -8,6 +8,7 @@ import com.earth2me.essentials.Trade.OverflowType; import com.earth2me.essentials.utils.NumberUtil; import java.math.BigDecimal; import java.util.Map; +import org.bukkit.Material; import org.bukkit.inventory.ItemStack; //TODO: TL exceptions @@ -102,7 +103,7 @@ public class SignTrade extends EssentialsSign { final Trade trade = getTrade(sign, 2, AmountType.COST, false, ess); if (trade.getItemStack() != null && player.getItemInHand() != null - && trade.getItemStack().getTypeId() == player.getItemInHand().getTypeId() + && trade.getItemStack().getType() == player.getItemInHand().getType() && trade.getItemStack().getDurability() == player.getItemInHand().getDurability() && trade.getItemStack().getEnchantments().equals(player.getItemInHand().getEnchantments())) { @@ -212,7 +213,7 @@ public class SignTrade extends EssentialsSign throw new SignException(_("moreThanZero")); } if (!(split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp")) - && getItemStack(split[1], amount, ess).getTypeId() == 0) + && getItemStack(split[1], amount, ess).getType() == Material.AIR) { throw new SignException(_("moreThanZero")); } @@ -235,7 +236,7 @@ public class SignTrade extends EssentialsSign throw new SignException(_("moreThanZero")); } if (!(split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp")) - && getItemStack(split[1], stackamount, ess).getTypeId() == 0) + && getItemStack(split[1], stackamount, ess).getType() == Material.AIR) { throw new SignException(_("moreThanZero")); } @@ -296,7 +297,7 @@ public class SignTrade extends EssentialsSign { amount -= amount % stackamount; } - if (notEmpty && (amount < 1 || stackamount < 1 || item.getTypeId() == 0 || amount < stackamount)) + if (notEmpty && (amount < 1 || stackamount < 1 || item.getType() == Material.AIR || amount < stackamount)) { throw new SignException(_("tradeSignEmpty")); } |