From d33c8df675ac6fc0c379a9af11808949c6c037f8 Mon Sep 17 00:00:00 2001 From: Taah Date: Fri, 8 Apr 2022 00:40:42 -0700 Subject: [PATCH 1/2] add fleek to devs list --- src/main/java/dev/plex/util/PlexUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/dev/plex/util/PlexUtils.java b/src/main/java/dev/plex/util/PlexUtils.java index e36c4d6..37653a4 100644 --- a/src/main/java/dev/plex/util/PlexUtils.java +++ b/src/main/java/dev/plex/util/PlexUtils.java @@ -51,7 +51,8 @@ public class PlexUtils extends PlexBase public static List DEVELOPERS = Arrays.asList("78408086-1991-4c33-a571-d8fa325465b2", // Telesphoreo "f5cd54c4-3a24-4213-9a56-c06c49594dff", // Taahh - "ca83b658-c03b-4106-9edc-72f70a80656d" // ayunami2000 + "ca83b658-c03b-4106-9edc-72f70a80656d", // ayunami2000 + "2e06e049-24c8-42e4-8bcf-d35372af31e6" //Fleek ); static From 3039125b48a7d251888d1c7c9aafb02842b6272e Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Fri, 8 Apr 2022 16:37:13 -0500 Subject: [PATCH 2/2] Improve it more --- .../dev/plex/listener/impl/WorldListener.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/plex/listener/impl/WorldListener.java b/src/main/java/dev/plex/listener/impl/WorldListener.java index 83a0930..b2b319e 100644 --- a/src/main/java/dev/plex/listener/impl/WorldListener.java +++ b/src/main/java/dev/plex/listener/impl/WorldListener.java @@ -126,10 +126,21 @@ public class WorldListener extends PlexListener public void onWorldTeleport(PlayerTeleportEvent e) { final World adminworld = Bukkit.getWorld("adminworld"); - PlexPlayer plexPlayer = DataUtils.getPlayer(e.getPlayer().getUniqueId()); - if (e.getTo().getWorld().equals(adminworld) && !plexPlayer.isAdminActive()) + if (adminworld == null) { - e.setCancelled(true); + return; + } + PlexPlayer plexPlayer = DataUtils.getPlayer(e.getPlayer().getUniqueId()); + if (e.getTo().getWorld().equals(adminworld)) + { + if (plugin.getSystem().equals("ranks") && !plexPlayer.isAdminActive()) + { + e.setCancelled(true); + } + else if (plugin.getSystem().equals("permissions") && !e.getPlayer().hasPermission("plex.enter.adminworld")) + { + e.setCancelled(true); + } } }