@EventHandler(priority = EventPriority.NORMAL) public void onChat(final AsyncPlayerChatEvent event) { if (Bukkit.getServer().getPluginManager().getPlugin("mcMMO") != null) { if (!Users.getProfile(event.getPlayer().getName()).getAdminChatMode()) { if (event.isCancelled()) { return; } } } else if (event.isCancelled()) { return; } try { final Player player = event.getPlayer(); for (final IRCChannel c : MonsterIRC.getChannels()) { if (c.getChatType() == ChatType.MTADMINCHAT) { continue; } if (c.getChatType() == ChatType.TOWNYCHAT) { continue; } MonsterIRCListener.handleMessage(player, c, event.getMessage()); } } catch (final Exception e) { IRC.debug(e); } }
@EventHandler(priority = EventPriority.NORMAL) public void onServerCommand(final ServerCommandEvent event) { if (Variables.passSay) { if (event.getCommand().startsWith("say")) { for (final IRCChannel c : MonsterIRC.getChannels()) { MonsterIRCListener.handleMessage(null, c, event.getCommand().toString().substring(4)); } } } }