Skip to content

Commit

Permalink
Ignore cancelled events
Browse files Browse the repository at this point in the history
I am actually surprised it wasn't a thing
  • Loading branch information
voidpointer0x00 committed Apr 18, 2023
1 parent 4251375 commit 917cfd7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public final class LoginListener implements Listener {
@Autowired private static WhitelistConfig whitelistConfig;
@Autowired private static KickTaskScheduler kickTaskScheduler;

@EventHandler(priority=EventPriority.NORMAL)
@EventHandler(priority=EventPriority.NORMAL, ignoreCancelled=true)
public void onAsyncPreLogin(final AsyncPlayerPreLoginEvent event) {
/* This listener disallows login if the connecting user is not on the whitelist,
* and due to either configuration or exceeding auto-whitelist.max-repeats limit
Expand Down Expand Up @@ -109,7 +109,7 @@ private void disallow(final AsyncPlayerPreLoginEvent event, final KickReason rea
event.disallow(KICK_WHITELIST, locale.localize(WhitelistMessage.of(reason)).getRawMessage());
}

@EventHandler(priority=EventPriority.MONITOR)
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true)
public void scheduleKickOnJoin(final PlayerJoinEvent event) {
if (!whitelistConfig.isWhitelistEnabled())
return;
Expand Down

0 comments on commit 917cfd7

Please sign in to comment.