this.commandSender.setMessageTarget(event.getChannel().getName());
this.commandSender.setName(playerName);
plugin.server.dispatchCommand(this.commandSender, command);
}else{
RemotePlayerChatEvent chatEvent = new RemotePlayerChatEvent(playerName, message, new HashSet<Player>(Arrays.asList(plugin.server.getOnlinePlayers())));
plugin.pluginManager.callEvent(chatEvent);
if (!chatEvent.isCancelled()){
String chatMessage = String.format(chatEvent.getFormat(), playerName, ChatColorHelper.convertIRCtoMC(message));
for (Player recipient : chatEvent.getRecipients()){
recipient.sendMessage(chatMessage);
}
plugin.server.getConsoleSender().sendMessage(chatMessage);
}