mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
- Make adminworld check for ranks or permissions
This commit is contained in:
parent
d4578f2255
commit
93fa38d9da
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
|
|
||||||
import static dev.plex.util.PlexUtils.tl;
|
import static dev.plex.util.PlexUtils.tl;
|
||||||
|
|
||||||
public class WorldListener extends PlexListener
|
public class WorldListener extends PlexListener
|
||||||
@ -22,12 +23,20 @@ public class WorldListener extends PlexListener
|
|||||||
World world = player.getWorld();
|
World world = player.getWorld();
|
||||||
switch (world.getName().toLowerCase())
|
switch (world.getName().toLowerCase())
|
||||||
{
|
{
|
||||||
case "adminworld":
|
case "adminworld" -> {
|
||||||
|
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||||
{
|
{
|
||||||
if (plexPlayer.getRankFromString().isAtLeast(Rank.ADMIN))
|
if (plexPlayer.getRankFromString().isAtLeast(Rank.ADMIN))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||||
|
{
|
||||||
|
if (player.hasPermission("plex.adminworld"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
player.sendMessage(tl("noAdminWorldBlockPlace"));
|
player.sendMessage(tl("noAdminWorldBlockPlace"));
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user