From 8f55be369ff15a584b06b2b5ac8d87d3c8fdde9e Mon Sep 17 00:00:00 2001 From: Deauthorized <49701242+Deauthorized@users.noreply.github.com> Date: Thu, 2 May 2024 17:26:20 -0400 Subject: [PATCH] Update ListCMD.java --- .../main/java/dev/plex/command/impl/ListCMD.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/server/src/main/java/dev/plex/command/impl/ListCMD.java b/server/src/main/java/dev/plex/command/impl/ListCMD.java index 809d857..b57a6c5 100644 --- a/server/src/main/java/dev/plex/command/impl/ListCMD.java +++ b/server/src/main/java/dev/plex/command/impl/ListCMD.java @@ -2,6 +2,7 @@ package dev.plex.command.impl; import com.google.common.collect.Lists; import dev.plex.command.PlexCommand; +import dev.plex.util.PlexUtils; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.hook.VaultHook; @@ -27,17 +28,7 @@ public class ListCMD extends PlexCommand List players = Lists.newArrayList(Bukkit.getOnlinePlayers()); players.removeIf(PlayerMeta::isVanished); Component list = Component.empty(); - Component header = Component.text("There " + (players.size() == 1 ? "is" : "are") + " currently").color(NamedTextColor.GRAY) - .append(Component.space()) - .append(Component.text(players.size()).color(NamedTextColor.YELLOW)) - .append(Component.space()) - .append(Component.text(players.size() == 1 ? "player" : "players").color(NamedTextColor.GRAY)) - .append(Component.space()) - .append(Component.text("online out of").color(NamedTextColor.GRAY)) - .append(Component.space()) - .append(Component.text(Bukkit.getMaxPlayers()).color(NamedTextColor.YELLOW)) - .append(Component.space()) - .append(Component.text(Bukkit.getMaxPlayers() == 1 ? "player." : "players.").color(NamedTextColor.GRAY)); + Component header = PlexUtils.messageComponent(players.size() == 1 ? "listHeader" : "listHeaderPlural", players.size(), Bukkit.getMaxPlayers()); send(sender, header); if (players.isEmpty()) {