    001package net.minecraft.command;
    002
    003import net.minecraft.server.MinecraftServer;
    004
    005public class CommandToggleDownfall extends CommandBase
    006{
    007    public String getCommandName()
    008    {
    009        return "toggledownfall";
    010    }
    011
    012    /**
    013     * Return the required permission level for this command.
    014     */
    015    public int getRequiredPermissionLevel()
    016    {
    017        return 2;
    018    }
    019
    020    public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    021    {
    022        this.toggleDownfall();
    023        notifyAdmins(par1ICommandSender, "commands.downfall.success", new Object[0]);
    024    }
    025
    026    /**
    027     * Toggle rain and enable thundering.
    028     */
    029    protected void toggleDownfall()
    030    {
    031        MinecraftServer.getServer().worldServers[0].toggleRain();
    032        MinecraftServer.getServer().worldServers[0].getWorldInfo().setThundering(true);
    033    }
    034}