Couple more bits of Eco cleanup

This commit is contained in:
KHobbits 2013-05-05 20:05:28 +01:00
parent 9ec1a6b78f
commit 1bb7946e13
3 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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)));
}