package net.minecraft.command;

import net.minecraft.server.MinecraftServer;
import net.minecraft.world.storage.WorldInfo;

public class CommandToggleDownfall extends CommandBase
{
	private static final String __OBFID = "CL_00001184";

	public String getCommandName()
	{
		return "toggledownfall";
	}

	public int getRequiredPermissionLevel()
	{
		return 2;
	}

	public String getCommandUsage(ICommandSender par1ICommandSender)
	{
		return "commands.downfall.usage";
	}

	public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
	{
		this.toggleDownfall();
		notifyAdmins(par1ICommandSender, "commands.downfall.success", new Object[0]);
	}

	protected void toggleDownfall()
	{
		WorldInfo worldinfo = MinecraftServer.getServer().worldServers[0].getWorldInfo();
		worldinfo.setRaining(!worldinfo.isRaining());
	}
}