feat: latency and gamemode in ListCommand

This commit is contained in:
ChomeNS
2025-03-30 17:02:38 +07:00
parent 8c65eb0ec1
commit c70e8b5779
2 changed files with 22 additions and 1 deletions

View File

@@ -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())