From 4d2fbd04c58ae5c2b16ff34ea2308f011cdb7e8f Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Tue, 8 Sep 2020 15:36:05 -0400 Subject: [PATCH] Fix /sell and /worth messages displaying {1} instead of the item(s) value (#3656) --- .../src/com/earth2me/essentials/commands/Commandsell.java | 5 +++-- .../src/com/earth2me/essentials/commands/Commandworth.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index 427e250a9..0032c003f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -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)); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java index 94f0f6ca9..913a82f40 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java @@ -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)); } }