    001    package net.minecraft.src;
    002
    003    import net.minecraft.server.MinecraftServer;
    004
    005    public class CommandDefaultGameMode extends CommandGameMode
    006    {
    007        public String getCommandName()
    008        {
    009            return "defaultgamemode";
    010        }
    011
    012        public String getCommandUsage(ICommandSender par1ICommandSender)
    013        {
    014            return par1ICommandSender.translateString("commands.defaultgamemode.usage", new Object[0]);
    015        }
    016
    017        public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    018        {
    019            if (par2ArrayOfStr.length > 0)
    020            {
    021                EnumGameType var3 = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]);
    022                this.setGameType(var3);
    023                String var4 = StatCollector.translateToLocal("gameMode." + var3.getName());
    024                notifyAdmins(par1ICommandSender, "commands.defaultgamemode.success", new Object[] {var4});
    025            }
    026            else
    027            {
    028                throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]);
    029            }
    030        }
    031
    032        protected void setGameType(EnumGameType par1EnumGameType)
    033        {
    034            MinecraftServer.getServer().setGameType(par1EnumGameType);
    035        }
    036    }