    001    package net.minecraft.src;
    002
    003    import net.minecraft.server.MinecraftServer;
    004
    005    public class CommandServerSaveAll extends CommandBase
    006    {
    007        public String getCommandName()
    008        {
    009            return "save-all";
    010        }
    011
    012        public int func_82362_a()
    013        {
    014            return 4;
    015        }
    016
    017        public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    018        {
    019            MinecraftServer var3 = MinecraftServer.getServer();
    020            par1ICommandSender.sendChatToPlayer(par1ICommandSender.translateString("commands.save.start", new Object[0]));
    021
    022            if (var3.getConfigurationManager() != null)
    023            {
    024                var3.getConfigurationManager().saveAllPlayerData();
    025            }
    026
    027            try
    028            {
    029                for (int var4 = 0; var4 < var3.worldServers.length; ++var4)
    030                {
    031                    if (var3.worldServers[var4] != null)
    032                    {
    033                        WorldServer var5 = var3.worldServers[var4];
    034                        boolean var6 = var5.canNotSave;
    035                        var5.canNotSave = false;
    036                        var5.saveAllChunks(true, (IProgressUpdate)null);
    037                        var5.canNotSave = var6;
    038                    }
    039                }
    040            }
    041            catch (MinecraftException var7)
    042            {
    043                notifyAdmins(par1ICommandSender, "commands.save.failed", new Object[] {var7.getMessage()});
    044                return;
    045            }
    046
    047            notifyAdmins(par1ICommandSender, "commands.save.success", new Object[0]);
    048        }
    049    }