mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
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 By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
parent
1d06c840a4
commit
a4a2fa8690
3 changed files with 18 additions and 3 deletions
|
@ -0,0 +1,4 @@
|
||||||
|
package org.bukkit.command;
|
||||||
|
|
||||||
|
public interface RemoteConsoleCommandSender extends CommandSender{
|
||||||
|
}
|
|
@ -505,6 +505,12 @@ public abstract class Event implements Serializable {
|
||||||
* @see org.bukkit.event.server.ServerCommandEvent
|
* @see org.bukkit.event.server.ServerCommandEvent
|
||||||
*/
|
*/
|
||||||
SERVER_COMMAND (Category.SERVER),
|
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)
|
* Called when a map is initialized (created or loaded into memory)
|
||||||
*
|
*
|
||||||
|
|
|
@ -9,10 +9,15 @@ import org.bukkit.command.ConsoleCommandSender;
|
||||||
public class ServerCommandEvent extends ServerEvent {
|
public class ServerCommandEvent extends ServerEvent {
|
||||||
private String command;
|
private String command;
|
||||||
private CommandSender sender;
|
private CommandSender sender;
|
||||||
|
@Deprecated
|
||||||
public ServerCommandEvent(ConsoleCommandSender console, String message) {
|
public ServerCommandEvent(ConsoleCommandSender console, String message) {
|
||||||
super(Type.SERVER_COMMAND);
|
this(Type.SERVER_COMMAND, console, message);
|
||||||
command = message;
|
}
|
||||||
sender = console;
|
|
||||||
|
public ServerCommandEvent(Type type, CommandSender sender, String command) {
|
||||||
|
super(type);
|
||||||
|
this.command = command;
|
||||||
|
this.sender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue