mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2025-01-07 16:27:43 +01:00
Reduce kick event spamming.
This commit is contained in:
parent
fd997cc348
commit
19f72d8927
@ -45,13 +45,19 @@ public class GamePlayerKickListener implements Listener {
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerKickEvent(PlayerKickEvent event) {
|
||||
plugin.logDebug("KICK: " + event.getPlayer().getName());
|
||||
if (!plugin.kickedPlayers.contains(event.getPlayer().getName())) {
|
||||
plugin.kickedPlayers.add(event.getPlayer().getName());
|
||||
plugin.logDebug("KICK: " + event.getPlayer().getName());
|
||||
if (plugin.kickedPlayers.contains(event.getPlayer().getName())) {
|
||||
plugin.logDebug("Player "
|
||||
+ event.getPlayer().getName()
|
||||
+ " is in the recently kicked list. Not sending kick message.");
|
||||
return;
|
||||
}
|
||||
for (PurpleBot ircBot : plugin.ircBots.values()) {
|
||||
ircBot.gameKick(event.getPlayer(), event.getLeaveMessage(), event.getReason());
|
||||
}
|
||||
if (!plugin.kickedPlayers.contains(event.getPlayer().getName())) {
|
||||
plugin.kickedPlayers.add(event.getPlayer().getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user