From 1bb7946e1303919af03bac748e96e6f7b07df2ec Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 5 May 2013 20:05:28 +0100 Subject: Couple more bits of Eco cleanup --- Essentials/src/com/earth2me/essentials/Trade.java | 4 ++-- Essentials/src/com/earth2me/essentials/User.java | 6 +++--- Essentials/src/com/earth2me/essentials/commands/Commandsell.java | 4 ++-- 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, 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, 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, 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))); } -- cgit v1.2.3