From 775d428671ed6eace044e93ed2519645a8dbadc9 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 19 Jan 2024 20:33:27 +0100 Subject: [PATCH] Fix SpectatorListener --- .../bausystem/features/world/SpectatorListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SpectatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/SpectatorListener.java index 43b04d2c..0fd30b13 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SpectatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/SpectatorListener.java @@ -21,10 +21,12 @@ package de.steamwar.bausystem.features.world; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; +import de.steamwar.bausystem.config.BauServer; import de.steamwar.bausystem.utils.BauMemberUpdateEvent; import de.steamwar.core.CraftbukkitWrapper; import de.steamwar.inventory.SWItem; import de.steamwar.linkage.Linked; +import de.steamwar.sql.BauweltMember; import de.steamwar.techhider.TechHider; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -128,6 +130,11 @@ public class SpectatorListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { + BauweltMember bauweltMember = BauweltMember.getBauMember(BauServer.getInstance().getOwner(), event.getPlayer().getUniqueId()); + if (bauweltMember == null) { + event.getPlayer().kickPlayer(""); + return; + } if (Permission.SUPERVISOR.hasPermission(event.getPlayer())) { return; }