summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorAndrew Ardill <andrew.ardill@gmail.com>2011-12-07 16:43:56 +1100
committerAndrew Ardill <andrew.ardill@gmail.com>2011-12-07 17:42:33 +1100
commitdb33bcd1e49facf2f316cdf68b827480a6876b19 (patch)
treeb473d4d40619fe36dd3e4d67175ca4832cd05557 /src/main
parent818842e65279ed995efbb0ead67eb5ff98a6c30b (diff)
downloadbukkit-db33bcd1e49facf2f316cdf68b827480a6876b19.tar
bukkit-db33bcd1e49facf2f316cdf68b827480a6876b19.tar.gz
bukkit-db33bcd1e49facf2f316cdf68b827480a6876b19.tar.lz
bukkit-db33bcd1e49facf2f316cdf68b827480a6876b19.tar.xz
bukkit-db33bcd1e49facf2f316cdf68b827480a6876b19.zip
BREAKING: Change ConsoleCommandSender to an interface.
Implementations will now need to implement the console command sender. This is done to increse the separation between the Bukkit API and it's implementations. This allows the implementations more freedom when dealing with consoles and reducing chances for breaking plugin compatibility in the future.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/command/ConsoleCommandSender.java88
1 files changed, 1 insertions, 87 deletions
diff --git a/src/main/java/org/bukkit/command/ConsoleCommandSender.java b/src/main/java/org/bukkit/command/ConsoleCommandSender.java
index 6c59c1b4..a74df60a 100644
--- a/src/main/java/org/bukkit/command/ConsoleCommandSender.java
+++ b/src/main/java/org/bukkit/command/ConsoleCommandSender.java
@@ -1,90 +1,4 @@
package org.bukkit.command;
-import java.util.Set;
-import org.bukkit.ChatColor;
-import org.bukkit.Server;
-import org.bukkit.permissions.PermissibleBase;
-import org.bukkit.permissions.Permission;
-import org.bukkit.permissions.PermissionAttachment;
-import org.bukkit.permissions.PermissionAttachmentInfo;
-import org.bukkit.plugin.Plugin;
-
-/**
- * Represents CLI input from a console
- */
-public class ConsoleCommandSender implements CommandSender {
- private final Server server;
- private final PermissibleBase perm = new PermissibleBase(this);
-
- protected ConsoleCommandSender(Server server) {
- this.server = server;
- }
-
- public void sendMessage(String message) {
- System.out.println(ChatColor.stripColor(message));
- }
-
- public boolean isOp() {
- return true;
- }
-
- public void setOp(boolean value) {
- throw new UnsupportedOperationException("Cannot change operator status of server console");
- }
-
- public boolean isPlayer() {
- return false;
- }
-
- public Server getServer() {
- return server;
- }
-
- public boolean isPermissionSet(String name) {
- return perm.isPermissionSet(name);
- }
-
- public boolean isPermissionSet(Permission perm) {
- return this.perm.isPermissionSet(perm);
- }
-
- public boolean hasPermission(String name) {
- return perm.hasPermission(name);
- }
-
- public boolean hasPermission(Permission perm) {
- return this.perm.hasPermission(perm);
- }
-
- public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) {
- return perm.addAttachment(plugin, name, value);
- }
-
- public PermissionAttachment addAttachment(Plugin plugin) {
- return perm.addAttachment(plugin);
- }
-
- public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) {
- return perm.addAttachment(plugin, name, value, ticks);
- }
-
- public PermissionAttachment addAttachment(Plugin plugin, int ticks) {
- return perm.addAttachment(plugin, ticks);
- }
-
- public void removeAttachment(PermissionAttachment attachment) {
- perm.removeAttachment(attachment);
- }
-
- public void recalculatePermissions() {
- perm.recalculatePermissions();
- }
-
- public Set<PermissionAttachmentInfo> getEffectivePermissions() {
- return perm.getEffectivePermissions();
- }
-
- public String getName() {
- return "CONSOLE";
- }
+public interface ConsoleCommandSender extends CommandSender{
}