package net.minecraft.command.server;

import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;

public class CommandTestFor extends CommandBase
{
	private static final String __OBFID = "CL_00001182";

	public String getCommandName()
	{
		return "testfor";
	}

	public int getRequiredPermissionLevel()
	{
		return 2;
	}

	public String getCommandUsage(ICommandSender par1ICommandSender)
	{
		return "commands.testfor.usage";
	}

	public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
	{
		if (par2ArrayOfStr.length != 1)
		{
			throw new WrongUsageException("commands.testfor.usage", new Object[0]);
		}
		else if (!(par1ICommandSender instanceof CommandBlockLogic))
		{
			throw new CommandException("commands.testfor.failed", new Object[0]);
		}
		else
		{
			getPlayer(par1ICommandSender, par2ArrayOfStr[0]);
		}
	}

	public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2)
	{
		return par2 == 0;
	}
}