diff --git a/paper-api/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java b/paper-api/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java new file mode 100644 index 0000000000..5ba3c438fe --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java @@ -0,0 +1,4 @@ +package org.bukkit.command; + +public interface RemoteConsoleCommandSender extends CommandSender{ +} diff --git a/paper-api/src/main/java/org/bukkit/event/Event.java b/paper-api/src/main/java/org/bukkit/event/Event.java index 25271f73eb..a5aab336cb 100644 --- a/paper-api/src/main/java/org/bukkit/event/Event.java +++ b/paper-api/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/paper-api/src/main/java/org/bukkit/event/server/ServerCommandEvent.java b/paper-api/src/main/java/org/bukkit/event/server/ServerCommandEvent.java index 2d87be99d9..b33044ed00 100644 --- a/paper-api/src/main/java/org/bukkit/event/server/ServerCommandEvent.java +++ b/paper-api/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; } /**