mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Improve it more
This commit is contained in:
parent
e402cd1fe5
commit
3039125b48
@ -126,10 +126,21 @@ public class WorldListener extends PlexListener
|
|||||||
public void onWorldTeleport(PlayerTeleportEvent e)
|
public void onWorldTeleport(PlayerTeleportEvent e)
|
||||||
{
|
{
|
||||||
final World adminworld = Bukkit.getWorld("adminworld");
|
final World adminworld = Bukkit.getWorld("adminworld");
|
||||||
PlexPlayer plexPlayer = DataUtils.getPlayer(e.getPlayer().getUniqueId());
|
if (adminworld == null)
|
||||||
if (e.getTo().getWorld().equals(adminworld) && !plexPlayer.isAdminActive())
|
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user