mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-20 15:35:08 +00:00

Found using PMD and FindBugs. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1553 e251c2fe-e539-e718-e476-b85c1f46cddb
34 lines
785 B
Java
34 lines
785 B
Java
package com.earth2me.essentials;
|
|
|
|
import org.bukkit.Server;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.craftbukkit.CraftServer;
|
|
|
|
public final class Console implements IReplyTo {
|
|
private static Console instance = new Console();
|
|
private CommandSender replyTo;
|
|
public final static String NAME = "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 void setReplyTo(CommandSender user) {
|
|
replyTo = user;
|
|
}
|
|
|
|
public CommandSender getReplyTo() {
|
|
return replyTo;
|
|
}
|
|
|
|
public static Console getConsoleReplyTo() {
|
|
return instance;
|
|
}
|
|
}
|