001    package net.minecraft.src;
002    
003    public class RConConsoleSource implements ICommandSender
004    {
005        /** only ever used by MinecraftServer.executeCommand */
006        public static final RConConsoleSource consoleBuffer = new RConConsoleSource();
007        private StringBuffer chatBuffer = new StringBuffer();
008    
009        /**
010         * Clears the RCon log
011         */
012        public void resetLog()
013        {
014            this.chatBuffer.setLength(0);
015        }
016    
017        public String getChatBuffer()
018        {
019            return this.chatBuffer.toString();
020        }
021    
022        /**
023         * Gets the name of this command sender (usually username, but possibly "Rcon")
024         */
025        public String getCommandSenderName()
026        {
027            return "Rcon";
028        }
029    
030        public void sendChatToPlayer(String par1Str)
031        {
032            this.chatBuffer.append(par1Str);
033        }
034    
035        /**
036         * Returns true if the command sender is allowed to use the given command.
037         */
038        public boolean canCommandSenderUseCommand(int par1, String par2Str)
039        {
040            return true;
041        }
042    
043        /**
044         * Translates and formats the given string key with the given arguments.
045         */
046        public String translateString(String par1Str, Object ... par2ArrayOfObj)
047        {
048            return StringTranslate.getInstance().translateKeyFormat(par1Str, par2ArrayOfObj);
049        }
050    
051        /**
052         * Return the coordinates for this player as ChunkCoordinates.
053         */
054        public ChunkCoordinates getPlayerCoordinates()
055        {
056            return new ChunkCoordinates(0, 0, 0);
057        }
058    }