From db04231344a2c86476a513c40e3fd75adbcf9ffa Mon Sep 17 00:00:00 2001 From: Xitee <59659167+Xitee1@users.noreply.github.com> Date: Sun, 26 Apr 2026 19:25:26 +0200 Subject: [PATCH] Use vanilla whitelist as plugin failsafe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Override the vanilla whitelist on PlayerLoginEvent so regular players can join while the plugin is active. If the plugin is disabled or fails to load, the vanilla whitelist enforces and only whitelisted admins can connect — preventing unregulated access while the plugin's TrustLevel system is offline. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../java/de/xite/smp/listener/player/JoinQuitListener.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/de/xite/smp/listener/player/JoinQuitListener.java b/src/main/java/de/xite/smp/listener/player/JoinQuitListener.java index c1f6ac4..055c49c 100644 --- a/src/main/java/de/xite/smp/listener/player/JoinQuitListener.java +++ b/src/main/java/de/xite/smp/listener/player/JoinQuitListener.java @@ -30,6 +30,12 @@ public class JoinQuitListener implements Listener { public void onLogin(PlayerLoginEvent e) { Player p = e.getPlayer(); + // Vanilla-Whitelist aushebeln: das Plugin regelt den Zugang. + // Wenn das Plugin nicht läuft, greift die Whitelist und nur Admins kommen rein. + if(e.getResult() == Result.KICK_WHITELIST) { + e.allow(); + } + SMPPlayer smpp = SMPPlayer.getPlayer(p.getUniqueId()); if(!Database.isConnected() || smpp.getDataLoadingFailed()) { e.disallow(Result.KICK_OTHER, Component.text(