mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-25 23:13:56 +00:00
[trunk] /msg /r Reply to the console. Add /r console command.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1129 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
dbc653edb8
commit
57b5af7829
5 changed files with 89 additions and 54 deletions
34
Essentials/src/com/earth2me/essentials/Console.java
Normal file
34
Essentials/src/com/earth2me/essentials/Console.java
Normal file
|
@ -0,0 +1,34 @@
|
|||
package com.earth2me.essentials;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
|
||||
public 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("Invalid server!");
|
||||
}
|
||||
return ((CraftServer)server).getServer().console;
|
||||
}
|
||||
|
||||
public void setReplyTo(CommandSender user) {
|
||||
replyTo = user;
|
||||
}
|
||||
|
||||
public CommandSender getReplyTo() {
|
||||
return replyTo;
|
||||
}
|
||||
|
||||
public static Console getConsoleReplyTo() {
|
||||
return instance;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue