cba to do this

This commit is contained in:
Telesphoreo 2022-02-21 20:43:53 -06:00
parent be125f72f9
commit 3d3d92d72b
2 changed files with 9 additions and 7 deletions

View File

@ -10,11 +10,13 @@ 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
{ {
// TODO: Actually implement permissions for every world properly
private final String permission = plugin.config.getString("plex.adminworld.permission");
@EventHandler @EventHandler
public void onBlockPlace(BlockPlaceEvent e) public void onBlockPlace(BlockPlaceEvent e)
{ {
@ -30,9 +32,10 @@ public class WorldListener extends PlexListener
{ {
return; return;
} }
} else if (plugin.getSystem().equalsIgnoreCase("permissions")) }
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{ {
if (player.hasPermission("plex.adminworld")) if (player.hasPermission(permission));
{ {
return; return;
} }
@ -47,10 +50,6 @@ public class WorldListener extends PlexListener
@EventHandler @EventHandler
public void onEntitySpawn(EntitySpawnEvent e) public void onEntitySpawn(EntitySpawnEvent e)
{ {
if (!e.getLocation().getWorld().getName().equals("fionn"))
{
return;
}
if (e.getEntityType() != EntityType.SLIME) if (e.getEntityType() != EntityType.SLIME)
{ {
return; return;

View File

@ -36,6 +36,7 @@ data:
worlds: worlds:
flatlands: flatlands:
name: "Flatlands" name: "Flatlands"
permission: "plex.world.flatlands"
parameters: parameters:
grass_block: 1 grass_block: 1
dirt: 32 dirt: 32
@ -43,6 +44,7 @@ worlds:
bedrock: 1 bedrock: 1
adminworld: adminworld:
name: "Admin World" name: "Admin World"
permission: "plex.world.adminworld"
parameters: parameters:
grass_block: 1 grass_block: 1
dirt: 32 dirt: 32
@ -50,6 +52,7 @@ worlds:
bedrock: 1 bedrock: 1
masterbuilderworld: masterbuilderworld:
name: "MasterBuilder World" name: "MasterBuilder World"
permission: "plex.world.masterbuilderworld"
parameters: parameters:
grass_block: 1 grass_block: 1
dirt: 32 dirt: 32