mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 00:25:32 +01:00
Cleanup worth and sell messages
This commit is contained in:
parent
4eef8b5e84
commit
59515aed94
@ -181,7 +181,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
||||
{
|
||||
is.add(get(args[0]));
|
||||
}
|
||||
|
||||
|
||||
if (is.isEmpty() || is.get(0).getType() == Material.AIR)
|
||||
{
|
||||
throw new Exception(_("itemSellAir"));
|
||||
}
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class Commandsell extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count > 1 && totalWorth.signum() > 0)
|
||||
if (count != 1)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("blocks"))
|
||||
{
|
||||
@ -84,6 +84,9 @@ public class Commandsell extends EssentialsCommand
|
||||
|
||||
if (amount <= 0)
|
||||
{
|
||||
if (!isBulkSell) {
|
||||
user.sendMessage(_("itemSold", NumberUtil.displayCurrency(BigDecimal.ZERO, ess), BigDecimal.ZERO, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess)));
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
|
@ -56,9 +56,9 @@ public class Commandworth extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count > 1 && totalWorth.signum() > 0)
|
||||
if (count > 1)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("blocks"))
|
||||
if (args.length > 0 && args[0].equalsIgnoreCase("blocks"))
|
||||
{
|
||||
user.sendMessage(_("totalSellableBlocks", type, NumberUtil.displayCurrency(totalWorth, ess)));
|
||||
}
|
||||
@ -113,6 +113,11 @@ public class Commandworth extends EssentialsCommand
|
||||
throw new Exception(_("itemCannotBeSold"));
|
||||
}
|
||||
|
||||
if (amount < 0)
|
||||
{
|
||||
amount = 0;
|
||||
}
|
||||
|
||||
BigDecimal result = worth.multiply(BigDecimal.valueOf(amount));
|
||||
|
||||
sender.sendMessage(is.getDurability() != 0
|
||||
|
Loading…
Reference in New Issue
Block a user