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>
This commit is contained in:
Allink 2022-05-20 05:18:37 +01:00 committed by GitHub
parent 6936749213
commit 69ef06fc32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}