From 736a95b87840fa327b37a7e4db42d5d95116e29c Mon Sep 17 00:00:00 2001 From: creatorfromhell Date: Mon, 11 Dec 2023 22:08:18 -0500 Subject: [PATCH] Optimize imports. --- .../listeners/player/PlayerTeleportListener.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerTeleportListener.java b/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerTeleportListener.java index b7b7d48..30661b6 100644 --- a/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerTeleportListener.java +++ b/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerTeleportListener.java @@ -20,7 +20,6 @@ import me.lokka30.phantomworlds.PhantomWorlds; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; /** @@ -50,12 +49,12 @@ public void onPortal(PlayerTeleportEvent event) { final String cfgPath = "worlds-to-load." + event.getTo().getWorld().getName(); if(PhantomWorlds.instance().data.getConfig().getBoolean(cfgPath + ".whitelist", false) - && !event.getPlayer().hasPermission("phantomworlds.world.access." + event.getPlayer().getWorld())) { + && !event.getPlayer().hasPermission("phantomworlds.world.access." + event.getTo().getWorld().getName())) { event.setCancelled(true); return; } - if(event.getPlayer().hasPermission("phantomworlds.world.deny." + event.getPlayer().getWorld())) { + if(event.getPlayer().hasPermission("phantomworlds.world.deny." + event.getTo().getWorld().getName())) { event.setCancelled(true); } }