CommandListPlayers .java

net.minecraft.command.server.CommandListPlayers (class, 48 lines): members: getRequiredPermissionLevel, getCommandUsage, getCommandName, processCommand.

net.minecraft.command.serverclass48 linesserverextends CommandBase1.5 KB

API Surface (4)

String getCommandName()
int getRequiredPermissionLevel()
String getCommandUsage(ICommandSender sender)
void processCommand(ICommandSender sender, String[] args)

String literals (4)

"list"
"commands.players.usage"
"commands.players.list"
"uuids"

Full Source

CommandListPlayers.java48 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.command.server;
2
3
import net.minecraft.command.CommandBase;
4
import net.minecraft.command.CommandException;
5
import net.minecraft.command.CommandResultStats;
6
import net.minecraft.command.ICommandSender;
7
import net.minecraft.server.MinecraftServer;
8
import net.minecraft.util.ChatComponentText;
9
import net.minecraft.util.ChatComponentTranslation;
10
11
public class CommandListPlayers extends CommandBase
12
{
13
    /**
14
     * Gets the name of the command
15
     */
16
    public String getCommandName()
17
    {
18
        return "list";
19
    }
20
21
    /**
22
     * Return the required permission level for this command.
23
     */
24
    public int getRequiredPermissionLevel()
25
    {
26
        return 0;
27
    }
28
29
    /**
30
     * Gets the usage string for the command.
31
     */
32
    public String getCommandUsage(ICommandSender sender)
33
    {
34
        return "commands.players.usage";
35
    }
36
37
    /**
38
     * Callback when the command is invoked
39
     */
40
    public void processCommand(ICommandSender sender, String[] args) throws CommandException
41
    {
42
        int i = MinecraftServer.getServer().getCurrentPlayerCount();
43
        sender.addChatMessage(new ChatComponentTranslation("commands.players.list", new Object[] {Integer.valueOf(i), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())}));
44
        sender.addChatMessage(new ChatComponentText(MinecraftServer.getServer().getConfigurationManager().func_181058_b(args.length > 0 && "uuids".equalsIgnoreCase(args[0]))));
45
        sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, i);
46
    }
47
}
48

Deobfuscated MCP 1.8.9 source of CommandListPlayers from Marcelektro/MavenMCP-1.8.9 (net/minecraft/command/server/CommandListPlayers.java), stored verbatim.