summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-05-05 20:05:28 +0100
committerKHobbits <rob@khobbits.co.uk>2013-05-05 20:05:28 +0100
commit1bb7946e1303919af03bac748e96e6f7b07df2ec (patch)
treed3b9e0f34443712cb62eae08dfa61d3921633295
parent9ec1a6b78f355fc222d09fea2eb0d6220266b187 (diff)
downloadEssentials-1bb7946e1303919af03bac748e96e6f7b07df2ec.tar
Essentials-1bb7946e1303919af03bac748e96e6f7b07df2ec.tar.gz
Essentials-1bb7946e1303919af03bac748e96e6f7b07df2ec.tar.lz
Essentials-1bb7946e1303919af03bac748e96e6f7b07df2ec.tar.xz
Essentials-1bb7946e1303919af03bac748e96e6f7b07df2ec.zip
Couple more bits of Eco cleanup
-rw-r--r--Essentials/src/com/earth2me/essentials/Trade.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java4
3 files changed, 7 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
index 9fd852190..7a71d60cc 100644
--- a/Essentials/src/com/earth2me/essentials/Trade.java
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -243,7 +243,7 @@ public class Trade
if (command != null && !command.isEmpty())
{
cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command);
- if (cost.compareTo(BigDecimal.ZERO) == 0 && fallbackTrade != null)
+ if (cost.signum() == 0 && fallbackTrade != null)
{
cost = fallbackTrade.getCommandCost(user);
}
@@ -253,7 +253,7 @@ public class Trade
ess.getLogger().log(Level.INFO, "calculated command (" + command + ") cost for " + user.getName() + " as " + cost);
}
}
- if (cost.compareTo(BigDecimal.ZERO) != 0 && (user.isAuthorized("essentials.nocommandcost.all")
+ if (cost.signum() != 0 && (user.isAuthorized("essentials.nocommandcost.all")
|| user.isAuthorized("essentials.nocommandcost." + command)))
{
return BigDecimal.ZERO;
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index 690322d68..4b9e6e81d 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -128,7 +128,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
public void giveMoney(final BigDecimal value, final CommandSender initiator)
{
- if (value.compareTo(BigDecimal.ZERO) == 0)
+ if (value.signum() == 0)
{
return;
}
@@ -142,7 +142,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
public void payUser(final User reciever, final BigDecimal value) throws Exception
{
- if (value.compareTo(BigDecimal.ZERO) == 0)
+ if (value.signum() == 0)
{
return;
}
@@ -167,7 +167,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
public void takeMoney(final BigDecimal value, final CommandSender initiator)
{
- if (value.compareTo(BigDecimal.ZERO) == 0)
+ if (value.signum() == 0)
{
return;
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index 8bf5c7926..a0a142630 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -49,7 +49,7 @@ public class Commandsell extends EssentialsCommand
{
}
}
- if (totalWorth.compareTo(BigDecimal.ZERO) > 0)
+ if (totalWorth.signum() > 0)
{
user.sendMessage(_("totalWorthAll", type, Util.displayCurrency(totalWorth, ess)));
}
@@ -71,7 +71,7 @@ public class Commandsell extends EssentialsCommand
{
}
}
- if (totalWorth.compareTo(BigDecimal.ZERO) > 0)
+ if (totalWorth.signum() > 0)
{
user.sendMessage(_("totalWorthBlocks", type, Util.displayCurrency(totalWorth, ess)));
}