Fix /sell and /worth messages displaying {1} instead of the item(s) value (#3656)

This commit is contained in:
Josh Roy 2020-09-08 15:36:05 -04:00 committed by GitHub
parent dc6b9b89cd
commit 4d2fbd04c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -80,10 +80,11 @@ public class Commandsell extends EssentialsCommand {
ess.showError(user.getSource(), new Exception(tl("cannotSellTheseNamedItems", String.join(ChatColor.RESET + ", ", names))), commandLabel);
}
if (count != 1) {
String totalWorthStr = NumberUtil.displayCurrency(totalWorth, ess);
if (args[0].equalsIgnoreCase("blocks")) {
user.sendMessage(tl("totalWorthBlocks", NumberUtil.displayCurrency(totalWorth, ess)));
user.sendMessage(tl("totalWorthBlocks", totalWorthStr, totalWorthStr));
} else {
user.sendMessage(tl("totalWorthAll", NumberUtil.displayCurrency(totalWorth, ess)));
user.sendMessage(tl("totalWorthAll", totalWorthStr, totalWorthStr));
}
}
}

View File

@ -46,11 +46,12 @@ public class Commandworth extends EssentialsCommand {
}
}
if (count > 1) {
String totalWorthStr = NumberUtil.displayCurrency(totalWorth, ess);
if (args.length > 0 && args[0].equalsIgnoreCase("blocks")) {
user.sendMessage(tl("totalSellableBlocks", NumberUtil.displayCurrency(totalWorth, ess)));
user.sendMessage(tl("totalSellableBlocks", totalWorthStr, totalWorthStr));
return;
}
user.sendMessage(tl("totalSellableAll", NumberUtil.displayCurrency(totalWorth, ess)));
user.sendMessage(tl("totalSellableAll", totalWorthStr, totalWorthStr));
}
}