diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/Console.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Console.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Console.java b/Essentials/src/com/earth2me/essentials/Console.java index 882c4f2c8..dcdb65a0d 100644 --- a/Essentials/src/com/earth2me/essentials/Console.java +++ b/Essentials/src/com/earth2me/essentials/Console.java @@ -2,33 +2,35 @@ package com.earth2me.essentials; import org.bukkit.Server; import org.bukkit.command.CommandSender; -import org.bukkit.craftbukkit.CraftServer; -public final class Console implements IReplyTo { + +public final class Console implements IReplyTo +{ private static Console instance = new Console(); private CommandSender replyTo; public final static String NAME = "Console"; - - private Console() { - + + private Console() + { } - - public static CommandSender getCommandSender(Server server) throws Exception { - if (! (server instanceof CraftServer)) { - throw new Exception(Util.i18n("invalidServer")); - } - return ((CraftServer)server).getServer().console; + + public static CommandSender getCommandSender(Server server) throws Exception + { + return server.getConsoleSender(); } - public void setReplyTo(CommandSender user) { + public void setReplyTo(CommandSender user) + { replyTo = user; } - public CommandSender getReplyTo() { + public CommandSender getReplyTo() + { return replyTo; } - - public static Console getConsoleReplyTo() { + + public static Console getConsoleReplyTo() + { return instance; } } |