From 69ef06fc32932d20c2b43a164f15ccf2c6e0d72f Mon Sep 17 00:00:00 2001 From: Allink <44676012+allinkdev@users.noreply.github.com> Date: Fri, 20 May 2022 05:18:37 +0100 Subject: [PATCH] Handle full server kicks separately from other join restrictions (#315) * Handle full server kicks separately from other join restrictions (closes #312) * Add missing condition * Add bracket back * Remove extra bracket Co-authored-by: Kaboom <58372747+kaboombot@users.noreply.github.com> --- .../kaboom/extras/modules/player/PlayerConnection.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java b/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java index ae712ea..d1fbed8 100644 --- a/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java +++ b/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java @@ -94,7 +94,14 @@ public final class PlayerConnection implements Listener { @EventHandler void onPlayerLogin(final PlayerLoginEvent event) { - if (!ENABLE_JOIN_RESTRICTIONS) { + // #312 - If allow join on full server is off, + // but join restrictions are disabled, + // player can still join on full server + + // Full server kicks should be handled differently from other join restrictions + // since we have a separate configuration value for it + + if (!ENABLE_JOIN_RESTRICTIONS && !Result.KICK_FULL.equals(event.getResult())) { event.allow(); }