Skip to content

Commit 8c156d4

Browse files
committed
use modern economy formatter
1 parent c9b3ecc commit 8c156d4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

addon/discordsrv/src/main/java/com/ghostchu/quickshop/addon/discordsrv/message/MessageFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ private Map<String, String> applyPlaceHoldersForPurchaseEvent(@NotNull Map<Strin
128128
placeHolders.put("purchase.world", shop.getLocation().getWorld().getName());
129129
placeHolders.put("purchase.amount", String.valueOf(event.getAmount()));
130130
placeHolders.put("purchase.balance", String.valueOf(event.getBalanceWithoutTax()));
131-
placeHolders.put("purchase.balance-formatted", purgeColors(plugin.getEconomy().format(event.getBalanceWithoutTax(), shop.getLocation().getWorld(), shop.getCurrency())));
131+
placeHolders.put("purchase.balance-formatted", purgeColors(plugin.getShopManager().format(event.getBalanceWithoutTax(), shop)));
132132
placeHolders.put("purchase.taxes", String.valueOf(event.getTax()));
133-
placeHolders.put("purchase.taxes-formatted", purgeColors(plugin.getEconomy().format(event.getTax(), shop.getLocation().getWorld(), shop.getCurrency())));
133+
placeHolders.put("purchase.taxes-formatted", purgeColors(plugin.getShopManager().format(event.getTax(), shop)));
134134
return placeHolders;
135135
}
136136

quickshop-bukkit/src/main/java/com/ghostchu/quickshop/command/subcommand/SubCommand_Price.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
110110
.currency(plugin.getCurrency())
111111
.build();
112112
if (!transaction.checkBalance()) {
113-
plugin.text().of(sender, "you-cant-afford-to-change-price", LegacyComponentSerializer.legacySection().deserialize(plugin.getEconomy().format(fee, shop.getLocation().getWorld(), shop.getCurrency()))).send();
113+
plugin.text().of(sender, "you-cant-afford-to-change-price", plugin.getShopManager().format(fee, shop)).send();
114114
return;
115115
}
116116
if (!transaction.failSafeCommit()) {
@@ -119,12 +119,12 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
119119
}
120120
}
121121
plugin.text().of(sender,
122-
"fee-charged-for-price-change", LegacyComponentSerializer.legacySection().deserialize(plugin.getEconomy().format(fee, shop.getLocation().getWorld(), plugin.getCurrency()))).send();
122+
"fee-charged-for-price-change", plugin.getShopManager().format(fee, shop)).send();
123123
// Update the shop
124124
shop.setPrice(price);
125125
shop.setSignText(plugin.text().findRelativeLanguages(sender));
126126
plugin.text().of(sender,
127-
"price-is-now", LegacyComponentSerializer.legacySection().deserialize(plugin.getEconomy().format(shop.getPrice(), Objects.requireNonNull(shop.getLocation().getWorld()), shop.getCurrency()))).send();
127+
"price-is-now", plugin.getShopManager().format(shop.getPrice(),shop)).send();
128128
// Chest shops can be double shops.
129129
if (!(shop instanceof final ContainerShop cs)) {
130130
return;

quickshop-bukkit/src/main/java/com/ghostchu/quickshop/util/MetricDataUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public String formatEconomy(@NotNull ShopMetricRecord record) {
3030
DecimalFormat df = new DecimalFormat("#.00");
3131
return df.format(record.getTotal());
3232
}
33-
return plugin.getEconomy().format(record.getTotal(), shop.getLocation().getWorld(), shop.getCurrency());
33+
return plugin.getShopManager().format(record.getTotal(), shop);
3434
}
3535

3636
@NotNull

0 commit comments

Comments
 (0)