From 818842e65279ed995efbb0ead67eb5ff98a6c30b Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Wed, 7 Dec 2011 16:37:35 +1100 Subject: Teach the API about Remote Consoles This will allow us to raise events for remote consoles, and provide access to them at a later date. Relates to BUKKIT-220 --- .../java/org/bukkit/command/RemoteConsoleCommandSender.java | 4 ++++ src/main/java/org/bukkit/event/Event.java | 6 ++++++ src/main/java/org/bukkit/event/server/ServerCommandEvent.java | 11 ++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java (limited to 'src') diff --git a/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java b/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java new file mode 100644 index 00000000..5ba3c438 --- /dev/null +++ b/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java @@ -0,0 +1,4 @@ +package org.bukkit.command; + +public interface RemoteConsoleCommandSender extends CommandSender{ +} diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java index 25271f73..a5aab336 100644 --- a/src/main/java/org/bukkit/event/Event.java +++ b/src/main/java/org/bukkit/event/Event.java @@ -505,6 +505,12 @@ public abstract class Event implements Serializable { * @see org.bukkit.event.server.ServerCommandEvent */ SERVER_COMMAND (Category.SERVER), + /** + * Called when a remote server command is called + * + * @see org.bukkit.event.server.ServerCommandEvent + */ + REMOTE_COMMAND(Category.SERVER), /** * Called when a map is initialized (created or loaded into memory) * diff --git a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java index 2d87be99..b33044ed 100644 --- a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java @@ -9,10 +9,15 @@ import org.bukkit.command.ConsoleCommandSender; public class ServerCommandEvent extends ServerEvent { private String command; private CommandSender sender; + @Deprecated public ServerCommandEvent(ConsoleCommandSender console, String message) { - super(Type.SERVER_COMMAND); - command = message; - sender = console; + this(Type.SERVER_COMMAND, console, message); + } + + public ServerCommandEvent(Type type, CommandSender sender, String command) { + super(type); + this.command = command; + this.sender = sender; } /** -- cgit v1.2.3