From cc3cd5e89c7beb92373aefcdf8386e701ff32792 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 6 Jan 2012 01:55:27 +0100 Subject: [PATCH] Cleanup of Console class --- Essentials/src/com/earth2me/essentials/Console.java | 6 ------ .../src/com/earth2me/essentials/commands/Commandmsg.java | 2 +- .../src/com/earth2me/essentials/xmpp/XMPPManager.java | 3 +-- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Console.java b/Essentials/src/com/earth2me/essentials/Console.java index 5bdfd5990..2e43883cf 100644 --- a/Essentials/src/com/earth2me/essentials/Console.java +++ b/Essentials/src/com/earth2me/essentials/Console.java @@ -1,7 +1,6 @@ package com.earth2me.essentials; import com.earth2me.essentials.api.IReplyTo; -import org.bukkit.Server; 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 public void setReplyTo(final CommandSender user) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 2b513d9c0..87445e11b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -40,7 +40,7 @@ public class Commandmsg extends EssentialsCommand if (args[0].equalsIgnoreCase(Console.NAME)) { sender.sendMessage(_("msgFormat", translatedMe, Console.NAME, message)); - CommandSender cs = Console.getCommandSender(server); + CommandSender cs = server.getConsoleSender(); cs.sendMessage(_("msgFormat", senderName, translatedMe, message)); replyTo.setReplyTo(cs); Console.getConsoleReplyTo().setReplyTo(sender); diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java index 95d4c4620..eb321ca81 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java @@ -1,6 +1,5 @@ package com.earth2me.essentials.xmpp; -import com.earth2me.essentials.Console; import com.earth2me.essentials.EssentialsConf; import com.earth2me.essentials.api.IReload; import com.earth2me.essentials.api.IUser; @@ -355,7 +354,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager { try { - parent.getServer().dispatchCommand(Console.getCommandSender(parent.getServer()), message.substring(1)); + parent.getServer().dispatchCommand(parent.getServer().getConsoleSender(), message.substring(1)); } catch (Exception ex) {