mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
Update ListCMD.java
This commit is contained in:
parent
5a7a2c1835
commit
8f55be369f
@ -2,6 +2,7 @@ package dev.plex.command.impl;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import dev.plex.command.PlexCommand;
|
import dev.plex.command.PlexCommand;
|
||||||
|
import dev.plex.util.PlexUtils;
|
||||||
import dev.plex.command.annotation.CommandParameters;
|
import dev.plex.command.annotation.CommandParameters;
|
||||||
import dev.plex.command.annotation.CommandPermissions;
|
import dev.plex.command.annotation.CommandPermissions;
|
||||||
import dev.plex.hook.VaultHook;
|
import dev.plex.hook.VaultHook;
|
||||||
@ -27,17 +28,7 @@ public class ListCMD extends PlexCommand
|
|||||||
List<Player> players = Lists.newArrayList(Bukkit.getOnlinePlayers());
|
List<Player> players = Lists.newArrayList(Bukkit.getOnlinePlayers());
|
||||||
players.removeIf(PlayerMeta::isVanished);
|
players.removeIf(PlayerMeta::isVanished);
|
||||||
Component list = Component.empty();
|
Component list = Component.empty();
|
||||||
Component header = Component.text("There " + (players.size() == 1 ? "is" : "are") + " currently").color(NamedTextColor.GRAY)
|
Component header = PlexUtils.messageComponent(players.size() == 1 ? "listHeader" : "listHeaderPlural", players.size(), Bukkit.getMaxPlayers());
|
||||||
.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));
|
|
||||||
send(sender, header);
|
send(sender, header);
|
||||||
if (players.isEmpty())
|
if (players.isEmpty())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user