use of cn.nukkit.event.server.RemoteServerCommandEvent in project Nukkit by Nukkit.
the class RCON method check.
public void check() {
if (this.serverThread == null) {
return;
} else if (!this.serverThread.isAlive()) {
return;
}
RCONCommand command;
while ((command = serverThread.receive()) != null) {
RemoteConsoleCommandSender sender = new RemoteConsoleCommandSender();
RemoteServerCommandEvent event = new RemoteServerCommandEvent(sender, command.getCommand());
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.server.dispatchCommand(sender, command.getCommand());
}
this.serverThread.respond(command.getSender(), command.getId(), TextFormat.clean(sender.getMessages()));
}
}
Aggregations