Implement new interface ConsoleCommandSender.
Also use abstracted ServerCommandSender to reduce complexity! Yay!
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package org.bukkit.craftbukkit.command;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
|
||||
/**
|
||||
* Represents CLI input from a console
|
||||
*/
|
||||
public class CraftConsoleCommandSender extends ServerCommandSender implements ConsoleCommandSender {
|
||||
|
||||
protected CraftConsoleCommandSender() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void sendMessage(String message) {
|
||||
System.out.println(ChatColor.stripColor(message));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "CONSOLE";
|
||||
}
|
||||
|
||||
public boolean isOp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setOp(boolean value) {
|
||||
throw new UnsupportedOperationException("Cannot change operator status of server console");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user