summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFearFree <fearfree@cubetown.net>2014-04-07 21:23:33 -0400
committerKHobbits <rob@khobbits.co.uk>2014-07-19 20:31:50 +0100
commit228bb27cb17057d92ea003dd02a0eba09c415998 (patch)
tree5d8bf60d3032beb29c67b11cf36b7096e9b45f22
parent4a51422266bb7e67e6d766cece91ea89f78afa4e (diff)
downloadEssentials-228bb27cb17057d92ea003dd02a0eba09c415998.tar
Essentials-228bb27cb17057d92ea003dd02a0eba09c415998.tar.gz
Essentials-228bb27cb17057d92ea003dd02a0eba09c415998.tar.lz
Essentials-228bb27cb17057d92ea003dd02a0eba09c415998.tar.xz
Essentials-228bb27cb17057d92ea003dd02a0eba09c415998.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.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java2
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)));
}
}