    001package net.minecraft.command;
    002
    003import net.minecraft.server.MinecraftServer;
    004import net.minecraft.world.WorldServer;
    005
    006public class CommandServerSaveOff extends CommandBase
    007{
    008    public String getCommandName()
    009    {
    010        return "save-off";
    011    }
    012
    013    /**
    014     * Return the required permission level for this command.
    015     */
    016    public int getRequiredPermissionLevel()
    017    {
    018        return 4;
    019    }
    020
    021    public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    022    {
    023        MinecraftServer minecraftserver = MinecraftServer.getServer();
    024
    025        for (int i = 0; i < minecraftserver.worldServers.length; ++i)
    026        {
    027            if (minecraftserver.worldServers[i] != null)
    028            {
    029                WorldServer worldserver = minecraftserver.worldServers[i];
    030                worldserver.canNotSave = true;
    031            }
    032        }
    033
    034        notifyAdmins(par1ICommandSender, "commands.save.disabled", new Object[0]);
    035    }
    036}