1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 12:01:20 +02:00

Cleanup of Console class

This commit is contained in:
snowleo
2012-01-06 01:55:27 +01:00
parent 3513d72a7b
commit cc3cd5e89c
3 changed files with 2 additions and 9 deletions

View File

@@ -1,7 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import com.earth2me.essentials.api.IReplyTo; import com.earth2me.essentials.api.IReplyTo;
import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@@ -15,11 +14,6 @@ public final class Console implements IReplyTo
{ {
} }
public static CommandSender getCommandSender(final Server server) throws Exception
{
return server.getConsoleSender();
}
@Override @Override
public void setReplyTo(final CommandSender user) public void setReplyTo(final CommandSender user)
{ {

View File

@@ -40,7 +40,7 @@ public class Commandmsg extends EssentialsCommand
if (args[0].equalsIgnoreCase(Console.NAME)) if (args[0].equalsIgnoreCase(Console.NAME))
{ {
sender.sendMessage(_("msgFormat", translatedMe, Console.NAME, message)); sender.sendMessage(_("msgFormat", translatedMe, Console.NAME, message));
CommandSender cs = Console.getCommandSender(server); CommandSender cs = server.getConsoleSender();
cs.sendMessage(_("msgFormat", senderName, translatedMe, message)); cs.sendMessage(_("msgFormat", senderName, translatedMe, message));
replyTo.setReplyTo(cs); replyTo.setReplyTo(cs);
Console.getConsoleReplyTo().setReplyTo(sender); Console.getConsoleReplyTo().setReplyTo(sender);

View File

@@ -1,6 +1,5 @@
package com.earth2me.essentials.xmpp; package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.Console;
import com.earth2me.essentials.EssentialsConf; import com.earth2me.essentials.EssentialsConf;
import com.earth2me.essentials.api.IReload; import com.earth2me.essentials.api.IReload;
import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.api.IUser;
@@ -355,7 +354,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
{ {
try try
{ {
parent.getServer().dispatchCommand(Console.getCommandSender(parent.getServer()), message.substring(1)); parent.getServer().dispatchCommand(parent.getServer().getConsoleSender(), message.substring(1));
} }
catch (Exception ex) catch (Exception ex)
{ {