use of org.bukkit.craftbukkit.v.util.LazyPlayerSet in project Arclight by IzzelAliz.
the class ServerPlayNetHandlerMixin method handleSlashCommand.
/**
* @author IzzelAliz
* @reason
*/
@Overwrite
private void handleSlashCommand(String s) {
if (SpigotConfig.logCommands) {
LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
}
CraftPlayer player = this.getPlayer();
PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, s, new LazyPlayerSet(this.minecraftServer));
this.server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
try {
minecraftServer.getCommandManager().handleCommand(((CraftPlayer) event.getPlayer()).getHandle().getCommandSource(), event.getMessage());
} catch (CommandException ex) {
player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to perform this command");
java.util.logging.Logger.getLogger(ServerPlayNetHandler.class.getName()).log(Level.SEVERE, null, ex);
}
}
Aggregations