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,11 +126,22 @@ 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");
|
||||||
|
if (adminworld == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
PlexPlayer plexPlayer = DataUtils.getPlayer(e.getPlayer().getUniqueId());
|
PlexPlayer plexPlayer = DataUtils.getPlayer(e.getPlayer().getUniqueId());
|
||||||
if (e.getTo().getWorld().equals(adminworld) && !plexPlayer.isAdminActive())
|
if (e.getTo().getWorld().equals(adminworld))
|
||||||
|
{
|
||||||
|
if (plugin.getSystem().equals("ranks") && !plexPlayer.isAdminActive())
|
||||||
{
|
{
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
else if (plugin.getSystem().equals("permissions") && !e.getPlayer().hasPermission("plex.enter.adminworld"))
|
||||||
|
{
|
||||||
|
e.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkLevel(PlexPlayer player, String[] requiredList)
|
private boolean checkLevel(PlexPlayer player, String[] requiredList)
|
||||||
|
Loading…
Reference in New Issue
Block a user