From 9b214c711178337c1c81cd81d1663408e602dee5 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 26 Oct 2024 18:18:16 +0700 Subject: [PATCH] Correct the message --- .../chomens_bot/commands/FindAltsCommand.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/FindAltsCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/FindAltsCommand.java index d53b815..e4c9602 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/FindAltsCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/FindAltsCommand.java @@ -33,6 +33,8 @@ public class FindAltsCommand extends Command { public Component execute(CommandContext context) throws Exception { final Bot bot = context.bot; + boolean argumentIsIP = true; + String targetIP; final String player = context.getString(true, true); @@ -41,6 +43,8 @@ public class FindAltsCommand extends Command { if (playerEntry == null) targetIP = player; else { + argumentIsIP = false; + final CompletableFuture future = bot.players.getPlayerIP(playerEntry); targetIP = future.get(5, TimeUnit.SECONDS); @@ -67,9 +71,12 @@ public class FindAltsCommand extends Command { .map(Map.Entry::getKey); Component component = Component - .translatable("Possible alts for the player %s:") + .translatable("Possible alts for the %s %s:") .color(ColorUtilities.getColorByString(bot.config.colorPalette.defaultColor)) - .arguments(Component.text(player).color(ColorUtilities.getColorByString(bot.config.colorPalette.username))) + .arguments( + Component.text(argumentIsIP ? "IP" : "player"), + Component.text(player).color(ColorUtilities.getColorByString(bot.config.colorPalette.username)) + ) .appendNewline(); int i = 0;