diff --git a/src/main/java/net/thenextlvl/economist/command/AccountCommand.java b/src/main/java/net/thenextlvl/economist/command/AccountCommand.java index 719faa3..8a310d4 100644 --- a/src/main/java/net/thenextlvl/economist/command/AccountCommand.java +++ b/src/main/java/net/thenextlvl/economist/command/AccountCommand.java @@ -144,7 +144,7 @@ private int prune(CommandContext context, @Nullable World wo @SneakyThrows private void prune(CommandContext context, List players, @Nullable World world) { var sender = context.getSource().getSender(); - var placeholder = Placeholder.parsed("world", world != null ? world.key().asString() : "null"); + var placeholder = Placeholder.parsed("world", world != null ? world.getName() : "null"); deleteAccounts(players.stream().map(OfflinePlayer::getUniqueId).toList(), world).thenAccept(success -> { var message = players.isEmpty() ? (world != null ? "account.prune.none.world" : "account.prune.none") @@ -163,14 +163,14 @@ private int create(CommandContext context, Collection { var message = world != null ? (player.equals(sender) ? "account.exists.world.self" : "account.exists.world.other") : (player.equals(sender) ? "account.exists.self" : "account.exists.other"); plugin.bundle().sendMessage(sender, message, Placeholder.parsed("player", player.getName() != null ? player.getName() : player.getUniqueId().toString()), - Placeholder.parsed("world", world != null ? world.key().asString() : "null")); + Placeholder.parsed("world", world != null ? world.getName() : "null")); return null; })); return Command.SINGLE_SUCCESS; @@ -188,7 +188,7 @@ private int delete(CommandContext context, Collection { plugin.getComponentLogger().error("Failed to delete account for {}", player.getName(), throwable); return null; diff --git a/src/main/java/net/thenextlvl/economist/command/BalanceCommand.java b/src/main/java/net/thenextlvl/economist/command/BalanceCommand.java index 509ad52..4d156fc 100644 --- a/src/main/java/net/thenextlvl/economist/command/BalanceCommand.java +++ b/src/main/java/net/thenextlvl/economist/command/BalanceCommand.java @@ -75,13 +75,13 @@ private int balance(CommandContext context, OfflinePlayer pl ? controller.getCurrencyNameSingular(locale) : controller.getCurrencyNamePlural(locale)), Placeholder.parsed("symbol", controller.getCurrencySymbol()), - Placeholder.parsed("world", world != null ? world.key().asString() : "null")); + Placeholder.parsed("world", world != null ? world.getName() : "null")); }, () -> plugin.bundle().sendMessage(sender, world != null ? (player.equals(sender) ? "account.not-found.world.self" : "account.not-found.world.other") : (player.equals(sender) ? "account.not-found.self" : "account.not-found.other"), Placeholder.parsed("player", String.valueOf(player.getName())), - Placeholder.parsed("world", world != null ? world.key().asString() : "null")))); + Placeholder.parsed("world", world != null ? world.getName() : "null")))); return Command.SINGLE_SUCCESS; } diff --git a/src/main/java/net/thenextlvl/economist/command/BalanceTopCommand.java b/src/main/java/net/thenextlvl/economist/command/BalanceTopCommand.java index e73c81f..9332e99 100644 --- a/src/main/java/net/thenextlvl/economist/command/BalanceTopCommand.java +++ b/src/main/java/net/thenextlvl/economist/command/BalanceTopCommand.java @@ -70,11 +70,11 @@ private void top(CommandSender sender, List accounts, int index, @Nulla var totalBalance = plugin.dataController().getTotalBalance(world).doubleValue(); plugin.bundle().sendMessage(sender, world != null ? "balance.top-list.header.world" : "balance.top-list.header", - Placeholder.parsed("world", world != null ? world.key().asString() : "null")); + Placeholder.parsed("world", world != null ? world.getName() : "null")); plugin.bundle().sendMessage(sender, world != null ? "balance.top-list.total.world" : "balance.top-list.total", Placeholder.parsed("symbol", plugin.economyController().getCurrencySymbol()), Placeholder.parsed("total", plugin.economyController().format(totalBalance, locale)), - Placeholder.parsed("world", world != null ? world.key().asString() : "null")); + Placeholder.parsed("world", world != null ? world.getName() : "null")); for (int i = 0; i < accounts.size(); i++) { var account = accounts.get(i); diff --git a/src/main/java/net/thenextlvl/economist/command/EconomyCommand.java b/src/main/java/net/thenextlvl/economist/command/EconomyCommand.java index 62aa12b..92cea78 100644 --- a/src/main/java/net/thenextlvl/economist/command/EconomyCommand.java +++ b/src/main/java/net/thenextlvl/economist/command/EconomyCommand.java @@ -115,7 +115,7 @@ private int execute(CommandContext context, String successMe .thenAccept(optional -> optional.ifPresentOrElse(account -> { var balance = function.apply(account, amount); plugin.bundle().sendMessage(sender, successMessage, - Placeholder.parsed("world", world != null ? world.key().asString() : "null"), + Placeholder.parsed("world", world != null ? world.getName() : "null"), Placeholder.parsed("player", String.valueOf(player.getName())), Placeholder.parsed("balance", plugin.economyController().format(balance, locale)), Placeholder.parsed("amount", plugin.economyController().format(amount, locale)), @@ -124,7 +124,7 @@ private int execute(CommandContext context, String successMe ? (sender.equals(player) ? "account.not-found.world.self" : "account.not-found.world.other") : (sender.equals(player) ? "account.not-found.self" : "account.not-found.other"), Placeholder.parsed("player", String.valueOf(player.getName())), - Placeholder.parsed("world", world != null ? world.key().asString() : "null"))))); + Placeholder.parsed("world", world != null ? world.getName() : "null"))))); else plugin.bundle().sendMessage(sender, "player.define"); return Command.SINGLE_SUCCESS; } diff --git a/src/main/java/net/thenextlvl/economist/command/PayCommand.java b/src/main/java/net/thenextlvl/economist/command/PayCommand.java index b56e202..2f8cf3a 100644 --- a/src/main/java/net/thenextlvl/economist/command/PayCommand.java +++ b/src/main/java/net/thenextlvl/economist/command/PayCommand.java @@ -115,6 +115,6 @@ private void missingAccount(@Nullable World world, Player sender, OfflinePlayer ? (player.equals(sender) ? "account.not-found.world.self" : "account.not-found.world.other") : (player.equals(sender) ? "account.not-found.self" : "account.not-found.other"), Placeholder.parsed("player", player.getName() != null ? player.getName() : player.getUniqueId().toString()), - Placeholder.parsed("world", world != null ? world.key().asString() : "null")); + Placeholder.parsed("world", world != null ? world.getName() : "null")); } }