@EventHandler(priority = EventPriority.NORMAL)
 public void onPlayerQuit(final PlayerQuitEvent event) {
   if (event.getQuitMessage() == null) {
     return;
   }
   for (final IRCChannel c : Variables.channels) {
     if (!c.getBlockedEvents().contains("game_quit")) {
       IRC.sendMessageToChannel(
           c.getChannel(),
           ColorUtils.formatGametoIRC(event.getPlayer().getDisplayName() + " has quit."));
     }
   }
 }
Example #2
0
 @EventHandler(priority = EventPriority.LOWEST)
 void playerQuit(PlayerQuitEvent event) {
   if (prefixOnQuit) {
     event.setQuitMessage(
         "["
             + plugin.getPlayerManager().getPlayer(event.getPlayer().getName()).getGroup()
             + "] "
             + event.getQuitMessage());
   }
   plugin.getPlayerManager().unregisterPlayer(event.getPlayer());
   if (plugin.getIRCBot() != null) {
     MinecraftQuitEvent evt = new MinecraftQuitEvent(event.getPlayer().getName());
     plugin.getServer().getPluginManager().callEvent(evt);
   }
 }