CommandToggleDownfall .java

net.minecraft.command.CommandToggleDownfall (class): members: toggleDownfall, getRequiredPermissionLevel, getCommandUsage, getCommandName, processCommand.

net.minecraft.commandclass50 linescommonextends CommandBase1.1 KB

API Surface (5)

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

String literals (3)

"toggledownfall"
"commands.downfall.usage"
"commands.downfall.success"

Code Graph: Dependencies (4)

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

Full Source

CommandToggleDownfall.java50 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.command;
2
3
import net.minecraft.server.MinecraftServer;
4
import net.minecraft.world.storage.WorldInfo;
5
6
public class CommandToggleDownfall extends CommandBase
7
{
8
    /**
9
     * Gets the name of the command
10
     */
11
    public String getCommandName()
12
    {
13
        return "toggledownfall";
14
    }
15
16
    /**
17
     * Return the required permission level for this command.
18
     */
19
    public int getRequiredPermissionLevel()
20
    {
21
        return 2;
22
    }
23
24
    /**
25
     * Gets the usage string for the command.
26
     */
27
    public String getCommandUsage(ICommandSender sender)
28
    {
29
        return "commands.downfall.usage";
30
    }
31
32
    /**
33
     * Callback when the command is invoked
34
     */
35
    public void processCommand(ICommandSender sender, String[] args) throws CommandException
36
    {
37
        this.toggleDownfall();
38
        notifyOperators(sender, this, "commands.downfall.success", new Object[0]);
39
    }
40
41
    /**
42
     * Toggle rain and enable thundering.
43
     */
44
    protected void toggleDownfall()
45
    {
46
        WorldInfo worldinfo = MinecraftServer.getServer().worldServers[0].getWorldInfo();
47
        worldinfo.setRaining(!worldinfo.isRaining());
48
    }
49
}
50

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