mirror of
https://github.com/AppleDash/SaneEconomy.git
synced 2024-11-14 06:08:08 +01:00
Fix bug in baltop and in ecoadmin
This commit is contained in:
parent
5ac6ba1407
commit
1f0df591fd
@ -65,6 +65,6 @@ public class BalanceTopCommand extends SaneCommand {
|
||||
AtomicInteger index = new AtomicInteger(offset + 1); /* I know it's stupid, but you can't do some_int++ from within the lambda. */
|
||||
|
||||
this.saneEconomy.getMessenger().sendMessage(sender, "Top {1} players on page {2}:", topBalances.size(), page);
|
||||
topBalances.forEach((player, balance) -> this.saneEconomy.getMessenger().sendMessage(sender, "[{1:02d}] {2} - {3}", index.getAndIncrement(), player.getName(), this.saneEconomy.getEconomyManager().getCurrency().formatAmount(balance)));
|
||||
topBalances.forEach((player, balance) -> this.saneEconomy.getMessenger().sendMessage(sender, "[{1:02d}] {2} - {3}", index.getAndIncrement(), player == null ? "<unknown>" : player.getName(), this.saneEconomy.getEconomyManager().getCurrency().formatAmount(balance)));
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class EconomyAdminCommand extends SaneCommand {
|
||||
|
||||
double amount = NumberUtils.parseAndFilter(ecoMan.getCurrency(), sAmount);
|
||||
|
||||
if (amount <= 0) {
|
||||
if (!(subCommand.equalsIgnoreCase("set") && amount == 0) && amount <= 0) { // If they're setting it to 0 it's fine, otherwise reject numbers under 1.
|
||||
this.saneEconomy.getMessenger().sendMessage(sender, "{1} is not a positive number.", ((amount == -1) ? sAmount : String.valueOf(amount)));
|
||||
return;
|
||||
}
|
||||
@ -117,7 +117,7 @@ public class EconomyAdminCommand extends SaneCommand {
|
||||
// FIXME: This is a silly hack to get it to log.
|
||||
if (oldBal > 0.0) {
|
||||
logger.logTransaction(new Transaction(
|
||||
economable, Economable.CONSOLE, oldBal, TransactionReason.ADMIN_GIVE
|
||||
economable, Economable.CONSOLE, oldBal, TransactionReason.ADMIN_TAKE
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class InteractListener implements Listener {
|
||||
player.getInventory().addItem(stack);
|
||||
|
||||
this.plugin.getMessenger().sendMessage(player, "You have bought {1} {2} for {3}.", quantity, shop.getItemStack().getType().name(), ecoMan.getCurrency().formatAmount(shopTransaction.getPrice()));
|
||||
LOGGER.info(String.format("%s just bought %s for %s.", player.getName(), shop.getItemStack(), ecoMan.getCurrency().formatAmount(shopTransaction.getPrice())));
|
||||
LOGGER.info(String.format("%s just bought %d %s for %s.", player.getName(), quantity, shop.getItemStack().getType().name(), ecoMan.getCurrency().formatAmount(shopTransaction.getPrice())));
|
||||
}
|
||||
|
||||
private void doSell(SignShop shop, Player player) { // TODO: Selling enchanted items
|
||||
@ -138,7 +138,7 @@ public class InteractListener implements Listener {
|
||||
ecoMan.transact(shopTransaction.makeEconomyTransaction());
|
||||
|
||||
this.plugin.getMessenger().sendMessage(player, "You have sold {1} {2} for {3}.", quantity, shop.getItemStack().getType().name(), ecoMan.getCurrency().formatAmount(price));
|
||||
LOGGER.info(String.format("%s just sold %s for %s.", player.getName(), shop.getItemStack(), ecoMan.getCurrency().formatAmount(price)));
|
||||
LOGGER.info(String.format("%s just sold %d %s for %s.", player.getName(), quantity, shop.getItemStack().getType().name(), ecoMan.getCurrency().formatAmount(price)));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user