// Change kick message. @EventHandler public void onPlayerKick(PlayerKickEvent event) { if (!Utilities.getUtilities().onlyfirstjoin()) { String message = plugin.getConfig().getString("messages.kickmessage"); if (!message.equalsIgnoreCase("none")) { event.setLeaveMessage(Utilities.getUtilities().format(message, event.getPlayer())); } else { event.setLeaveMessage(null); } } }
@EventHandler public void bannedPlayer(PlayerKickEvent e) { if (ban.isBanned(e.getPlayer())) { e.setLeaveMessage(""); } else if (ban.isTempBanned(e.getPlayer())) { if (!timeunits.isOverTime( fileManager.getLongValue( e.getPlayer().getName().toLowerCase() + ".yml", "time", fileManager.getDir() + File.separator + "bans"))) { e.setLeaveMessage(""); } } }
@EventHandler(ignoreCancelled = true) public void onPlayerKick(PlayerKickEvent event) { if (getSettingsManager().isLogoutTranslationEnabled()) { Localisation.sendGlobalMessage("message.logout", event.getPlayer()); event.setLeaveMessage(null); } }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) void playerKick(PlayerKickEvent event) { if (prefixOnQuit) { event.setLeaveMessage( "[" + plugin.getPlayerManager().getPlayer(event.getPlayer().getName()).getGroup() + "] " + event.getLeaveMessage()); } plugin.getPlayerManager().unregisterPlayer(event.getPlayer()); if (plugin.getIRCBot() != null) { MinecraftQuitEvent evt = new MinecraftQuitEvent(event.getPlayer().getName()); plugin.getServer().getPluginManager().callEvent(evt); } }
@EventHandler(priority = EventPriority.HIGHEST) public void onPlayerKickEvent(PlayerKickEvent event) { event.setLeaveMessage(null); this.onExit(event.getPlayer()); }