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