    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 void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    013        {
    014            MinecraftServer var3 = MinecraftServer.getServer();
    015            par1ICommandSender.sendChatToPlayer(par1ICommandSender.translateString("commands.save.start", new Object[0]));
    016
    017            if (var3.getConfigurationManager() != null)
    018            {
    019                var3.getConfigurationManager().saveAllPlayerData();
    020            }
    021
    022            try
    023            {
    024                for (int var4 = 0; var4 < var3.worldServers.length; ++var4)
    025                {
    026                    if (var3.worldServers[var4] != null)
    027                    {
    028                        WorldServer var5 = var3.worldServers[var4];
    029                        boolean var6 = var5.canNotSave;
    030                        var5.canNotSave = false;
    031                        var5.saveAllChunks(true, (IProgressUpdate)null);
    032                        var5.canNotSave = var6;
    033                    }
    034                }
    035            }
    036            catch (MinecraftException var7)
    037            {
    038                notifyAdmins(par1ICommandSender, "commands.save.failed", new Object[] {var7.getMessage()});
    039                return;
    040            }
    041
    042            notifyAdmins(par1ICommandSender, "commands.save.success", new Object[0]);
    043        }
    044    }