CommandSetPlayerTimeout .java

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

net.minecraft.commandclass48 linescommonextends CommandBase1.1 KB

API Surface (4)

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

String literals (3)

"setidletimeout"
"commands.setidletimeout.usage"
"commands.setidletimeout.success"

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

CommandSetPlayerTimeout.java48 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.command;
2
3
import net.minecraft.server.MinecraftServer;
4
5
public class CommandSetPlayerTimeout extends CommandBase
6
{
7
    /**
8
     * Gets the name of the command
9
     */
10
    public String getCommandName()
11
    {
12
        return "setidletimeout";
13
    }
14
15
    /**
16
     * Return the required permission level for this command.
17
     */
18
    public int getRequiredPermissionLevel()
19
    {
20
        return 3;
21
    }
22
23
    /**
24
     * Gets the usage string for the command.
25
     */
26
    public String getCommandUsage(ICommandSender sender)
27
    {
28
        return "commands.setidletimeout.usage";
29
    }
30
31
    /**
32
     * Callback when the command is invoked
33
     */
34
    public void processCommand(ICommandSender sender, String[] args) throws CommandException
35
    {
36
        if (args.length != 1)
37
        {
38
            throw new WrongUsageException("commands.setidletimeout.usage", new Object[0]);
39
        }
40
        else
41
        {
42
            int i = parseInt(args[0], 0);
43
            MinecraftServer.getServer().setPlayerIdleTimeout(i);
44
            notifyOperators(sender, this, "commands.setidletimeout.success", new Object[] {Integer.valueOf(i)});
45
        }
46
    }
47
}
48

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