From c70e8b5779b4a7f81de045e1b8dabc611788d245 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 30 Mar 2025 17:02:38 +0700 Subject: [PATCH] feat: latency and gamemode in ListCommand --- build-number.txt | 2 +- .../chomens_bot/commands/ListCommand.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/build-number.txt b/build-number.txt index 8d5106d1..4d7de05a 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -2263 \ No newline at end of file +2270 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/ListCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/ListCommand.java index be7b348e..7d8b77c2 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/ListCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/ListCommand.java @@ -46,6 +46,8 @@ public class ListCommand extends Command { // // Usernames: foo, bar, baz or No other usernames associated // Vanished: false + // Latency: 32 + // Game Mode: CREATIVE // // Click to copy the username to your clipboard // Shift+Click to insert the UUID into your chat box @@ -83,6 +85,25 @@ public class ListCommand extends Command { ).color(ColorUtilities.getColorByString(bot.config.colorPalette.secondary)) ) .append(Component.newline()) + .append( + Component.translatable( + "Latency: %s", + Component + .text(entry.latency) + .append(Component.text("ms")) + .color(ColorUtilities.getColorByString(bot.config.colorPalette.string)) // using number color palette will not blend in (GOLD) + ).color(ColorUtilities.getColorByString(bot.config.colorPalette.secondary)) + ) + .append(Component.newline()) + .append( + Component.translatable( + "Game Mode: %s", + Component + .text(entry.gamemode.name()) + .color(ColorUtilities.getColorByString(bot.config.colorPalette.string)) + ).color(ColorUtilities.getColorByString(bot.config.colorPalette.secondary)) + ) + .append(Component.newline()) .append(Component.newline()) .append(Component.text("Click to copy the username to your clipboard").color(NamedTextColor.GREEN)) .append(Component.newline())