summaryrefslogtreecommitdiffstats
path: root/EssentialsSigns
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-01-04 18:56:36 +0000
committerKHobbits <rob@khobbits.co.uk>2012-01-04 18:56:36 +0000
commita46f6fd73decdc47e5c2bf29c563d0deb20f0735 (patch)
tree7d9bf9d9d2d40ee929448c1b129881b9d1110a5c /EssentialsSigns
parent897571db7d838f0f2ff86cfb40b59fd0349f4974 (diff)
downloadEssentials-a46f6fd73decdc47e5c2bf29c563d0deb20f0735.tar
Essentials-a46f6fd73decdc47e5c2bf29c563d0deb20f0735.tar.gz
Essentials-a46f6fd73decdc47e5c2bf29c563d0deb20f0735.tar.lz
Essentials-a46f6fd73decdc47e5c2bf29c563d0deb20f0735.tar.xz
Essentials-a46f6fd73decdc47e5c2bf29c563d0deb20f0735.zip
Revert "Possible sign refactor?"
This reverts commit 897571db7d838f0f2ff86cfb40b59fd0349f4974.
Diffstat (limited to 'EssentialsSigns')
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignBuy.java5
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java5
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);