diff options
author | FearFree <fearfree@cubetown.net> | 2014-04-07 21:23:33 -0400 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2014-07-19 20:31:50 +0100 |
commit | a2c43d822c66e617a84df9a8f074b9c3a3e32fae (patch) | |
tree | 4d01d7b9a2ad439fef87453dd164885fe9ab60c3 | |
parent | 7907565377b4c2083c2bf28bc7c3730c2c6eef50 (diff) | |
download | Essentials-a2c43d822c66e617a84df9a8f074b9c3a3e32fae.tar Essentials-a2c43d822c66e617a84df9a8f074b9c3a3e32fae.tar.gz Essentials-a2c43d822c66e617a84df9a8f074b9c3a3e32fae.tar.lz Essentials-a2c43d822c66e617a84df9a8f074b9c3a3e32fae.tar.xz Essentials-a2c43d822c66e617a84df9a8f074b9c3a3e32fae.zip |
Add amount required to notEnoughMoney TL key.
See https://essentials3.atlassian.net/browse/ESS-5125 for request.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Trade.java | 15 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/User.java | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index e7426b4c4..c5298a4b1 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -3,6 +3,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import com.earth2me.essentials.craftbukkit.SetExpFix; +import com.earth2me.essentials.utils.NumberUtil; import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -28,7 +29,7 @@ public class Trade private final transient BigDecimal money; private final transient ItemStack itemStack; private final transient Integer exp; - private final transient com.earth2me.essentials.IEssentials ess; + private final transient IEssentials ess; public enum TradeType @@ -59,7 +60,7 @@ public class Trade @Deprecated public Trade(final double money, final com.earth2me.essentials.IEssentials ess) { - this(null, null, BigDecimal.valueOf(money), null, null, ess); + this(null, null, BigDecimal.valueOf(money), null, null, (IEssentials)ess); } public Trade(final BigDecimal money, final IEssentials ess) @@ -77,7 +78,7 @@ public class Trade this(null, null, null, null, exp, ess); } - private Trade(final String command, final Trade fallback, final BigDecimal money, final ItemStack item, final Integer exp, final com.earth2me.essentials.IEssentials ess) + private Trade(final String command, final Trade fallback, final BigDecimal money, final ItemStack item, final Integer exp, final IEssentials ess) { this.command = command; this.fallbackTrade = fallback; @@ -99,7 +100,7 @@ public class Trade && getMoney().signum() > 0 && !user.canAfford(getMoney())) { - throw new ChargeException(tl("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney", NumberUtil.displayCurrency(getMoney(), ess))); } if (getItemStack() != null @@ -113,7 +114,7 @@ public class Trade && (money = getCommandCost(user)).signum() > 0 && !user.canAfford(money)) { - throw new ChargeException(tl("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney", NumberUtil.displayCurrency(money, ess))); } if (exp != null && exp > 0 @@ -223,7 +224,7 @@ public class Trade } if (!user.canAfford(getMoney()) && getMoney().signum() > 0) { - throw new ChargeException(tl("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney", NumberUtil.displayCurrency(getMoney(), ess))); } user.takeMoney(getMoney()); } @@ -245,7 +246,7 @@ public class Trade final BigDecimal cost = getCommandCost(user); if (!user.canAfford(cost) && cost.signum() > 0) { - throw new ChargeException(tl("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney", NumberUtil.displayCurrency(cost, ess))); } user.takeMoney(cost); } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 2487fafc2..a0dc39843 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -172,7 +172,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es } else { - throw new ChargeException(tl("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney", NumberUtil.displayCurrency(value, ess))); } } |