diff options
Diffstat (limited to 'EssentialsSigns')
-rw-r--r-- | EssentialsSigns/src/com/earth2me/essentials/signs/SignBuy.java | 5 | ||||
-rw-r--r-- | EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBuy.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBuy.java index 628ed64c1..fd84bd0f3 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBuy.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBuy.java @@ -27,7 +27,10 @@ public class SignBuy extends EssentialsSign final Trade items = getTrade(sign, 1, 2, player, ess); final Trade charge = getTrade(sign, 3, ess); charge.isAffordableFor(player); - items.pay(player, false); + if (!items.pay(player, false)) + { + throw new ChargeException("Inventory full"); + } charge.charge(player); Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), ess); return true; diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java index df913eced..04db5511c 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java @@ -55,7 +55,10 @@ public class SignTrade extends EssentialsSign final Trade charge = getTrade(sign, 1, false, false, ess); final Trade trade = getTrade(sign, 2, false, true, ess); charge.isAffordableFor(player); - trade.pay(player, false); + if (!trade.pay(player, false)) + { + throw new ChargeException("Full inventory"); + } substractAmount(sign, 2, trade, ess); addAmount(sign, 1, charge, ess); charge.charge(player); |