diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-01 16:45:29 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-01 16:45:29 +0000 |
commit | 61f62597623d1d384b583f6934a34dc486cb3983 (patch) | |
tree | 6278daf8c0428de7da32255fc1eeab2a2a20af3d /src | |
parent | fb9fdc518eca023073b549c2a9db6a0f5f0cf785 (diff) | |
download | bukkit-61f62597623d1d384b583f6934a34dc486cb3983.tar bukkit-61f62597623d1d384b583f6934a34dc486cb3983.tar.gz bukkit-61f62597623d1d384b583f6934a34dc486cb3983.tar.lz bukkit-61f62597623d1d384b583f6934a34dc486cb3983.tar.xz bukkit-61f62597623d1d384b583f6934a34dc486cb3983.zip |
Deprecated CommandSender.isPlayer (instanceof!) and added ConsoleCommandSender
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/command/CommandSender.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/command/ConsoleCommandSender.java | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java index 64a4e988..713e325f 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java @@ -20,6 +20,8 @@ public interface CommandSender { * Checks if this sender is a player * * @return true if they are + * @deprecated Use instanceof */ + @Deprecated public boolean isPlayer(); }
\ No newline at end of file diff --git a/src/main/java/org/bukkit/command/ConsoleCommandSender.java b/src/main/java/org/bukkit/command/ConsoleCommandSender.java new file mode 100644 index 00000000..b8f805ce --- /dev/null +++ b/src/main/java/org/bukkit/command/ConsoleCommandSender.java @@ -0,0 +1,19 @@ + +package org.bukkit.command; + +/** + * Represents CLI input from a console + */ +public class ConsoleCommandSender implements CommandSender { + public void sendMessage(String message) { + System.out.println(message); + } + + public boolean isOp() { + return true; + } + + public boolean isPlayer() { + return false; + } +} |