package net.minecraft.command;
import java.util.Iterator;
import net.minecraft.command.server.CommandAchievement;
import net.minecraft.command.server.CommandBanIp;
import net.minecraft.command.server.CommandBanPlayer;
import net.minecraft.command.server.CommandBlockLogic;
import net.minecraft.command.server.CommandBroadcast;
import net.minecraft.command.server.CommandDeOp;
import net.minecraft.command.server.CommandEmote;
import net.minecraft.command.server.CommandListBans;
import net.minecraft.command.server.CommandListPlayers;
import net.minecraft.command.server.CommandMessage;
import net.minecraft.command.server.CommandMessageRaw;
import net.minecraft.command.server.CommandNetstat;
import net.minecraft.command.server.CommandOp;
import net.minecraft.command.server.CommandPardonIp;
import net.minecraft.command.server.CommandPardonPlayer;
import net.minecraft.command.server.CommandPublishLocalServer;
import net.minecraft.command.server.CommandSaveAll;
import net.minecraft.command.server.CommandSaveOff;
import net.minecraft.command.server.CommandSaveOn;
import net.minecraft.command.server.CommandScoreboard;
import net.minecraft.command.server.CommandSetBlock;
import net.minecraft.command.server.CommandSetDefaultSpawnpoint;
import net.minecraft.command.server.CommandStop;
import net.minecraft.command.server.CommandSummon;
import net.minecraft.command.server.CommandTeleport;
import net.minecraft.command.server.CommandTestFor;
import net.minecraft.command.server.CommandTestForBlock;
import net.minecraft.command.server.CommandWhitelist;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.rcon.RConConsoleSource;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
public class ServerCommandManager extends CommandHandler implements IAdminCommand
{
private static final String __OBFID = "CL_00000922";
public ServerCommandManager()
{
this.registerCommand(new CommandTime());
this.registerCommand(new CommandGameMode());
this.registerCommand(new CommandDifficulty());
this.registerCommand(new CommandDefaultGameMode());
this.registerCommand(new CommandKill());
this.registerCommand(new CommandToggleDownfall());
this.registerCommand(new CommandWeather());
this.registerCommand(new CommandXP());
this.registerCommand(new CommandTeleport());
this.registerCommand(new CommandGive());
this.registerCommand(new CommandEffect());
this.registerCommand(new CommandEnchant());
this.registerCommand(new CommandEmote());
this.registerCommand(new CommandShowSeed());
this.registerCommand(new CommandHelp());
this.registerCommand(new CommandDebug());
this.registerCommand(new CommandMessage());
this.registerCommand(new CommandBroadcast());
this.registerCommand(new CommandSetSpawnpoint());
this.registerCommand(new CommandSetDefaultSpawnpoint());
this.registerCommand(new CommandGameRule());
this.registerCommand(new CommandClearInventory());
this.registerCommand(new CommandTestFor());
this.registerCommand(new CommandSpreadPlayers());
this.registerCommand(new CommandPlaySound());
this.registerCommand(new CommandScoreboard());
this.registerCommand(new CommandAchievement());
this.registerCommand(new CommandSummon());
this.registerCommand(new CommandSetBlock());
this.registerCommand(new CommandTestForBlock());
this.registerCommand(new CommandMessageRaw());
if (MinecraftServer.getServer().isDedicatedServer())
{
this.registerCommand(new CommandOp());
this.registerCommand(new CommandDeOp());
this.registerCommand(new CommandStop());
this.registerCommand(new CommandSaveAll());
this.registerCommand(new CommandSaveOff());
this.registerCommand(new CommandSaveOn());
this.registerCommand(new CommandBanIp());
this.registerCommand(new CommandPardonIp());
this.registerCommand(new CommandBanPlayer());
this.registerCommand(new CommandListBans());
this.registerCommand(new CommandPardonPlayer());
this.registerCommand(new CommandServerKick());
this.registerCommand(new CommandListPlayers());
this.registerCommand(new CommandWhitelist());
this.registerCommand(new CommandSetPlayerTimeout());
this.registerCommand(new CommandNetstat());
}
else
{
this.registerCommand(new CommandPublishLocalServer());
}
CommandBase.setAdminCommander(this);
}
public void notifyOperators(ICommandSender sender, ICommand command, int p_152372_3_, String msgFormat, Object ... msgParams)
{
boolean flag = true;
if (sender instanceof CommandBlockLogic && !MinecraftServer.getServer().worldServers[0].getGameRules().getGameRuleBooleanValue("commandBlockOutput"))
{
flag = false;
}
ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.type.admin", new Object[] {sender.getCommandSenderName(), new ChatComponentTranslation(msgFormat, msgParams)});
chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY);
chatcomponenttranslation.getChatStyle().setItalic(Boolean.valueOf(true));
if (flag)
{
Iterator iterator = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator();
while (iterator.hasNext())
{
EntityPlayer entityplayer = (EntityPlayer)iterator.next();
if (entityplayer != sender && MinecraftServer.getServer().getConfigurationManager().canSendCommands(entityplayer.getGameProfile()) && command.canCommandSenderUseCommand(entityplayer) && (!(sender instanceof RConConsoleSource) || MinecraftServer.getServer().func_152363_m()))
{
entityplayer.addChatMessage(chatcomponenttranslation);
}
}
}
if (sender != MinecraftServer.getServer())
{
MinecraftServer.getServer().addChatMessage(chatcomponenttranslation);
}
if ((p_152372_3_ & 1) != 1)
{
sender.addChatMessage(new ChatComponentTranslation(msgFormat, msgParams));
}
}
}