    001package net.minecraft.command;
    002
    003import java.util.List;
    004import net.minecraft.network.packet.Packet3Chat;
    005import net.minecraft.server.MinecraftServer;
    006
    007public class CommandServerEmote extends CommandBase
    008{
    009    public String getCommandName()
    010    {
    011        return "me";
    012    }
    013
    014    /**
    015     * Return the required permission level for this command.
    016     */
    017    public int getRequiredPermissionLevel()
    018    {
    019        return 0;
    020    }
    021
    022    public String getCommandUsage(ICommandSender par1ICommandSender)
    023    {
    024        return par1ICommandSender.translateString("commands.me.usage", new Object[0]);
    025    }
    026
    027    public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    028    {
    029        if (par2ArrayOfStr.length > 0)
    030        {
    031            String s = func_82361_a(par1ICommandSender, par2ArrayOfStr, 0, par1ICommandSender.canCommandSenderUseCommand(1, "me"));
    032            MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat("* " + par1ICommandSender.getCommandSenderName() + " " + s));
    033        }
    034        else
    035        {
    036            throw new WrongUsageException("commands.me.usage", new Object[0]);
    037        }
    038    }
    039
    040    /**
    041     * Adds the strings available in this command to the given list of tab completion options.
    042     */
    043    public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    044    {
    045        return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames());
    046    }
    047}