Add supervisor permission on DynamicRegionVisualizer

This commit is contained in:
2026-03-17 19:16:49 +01:00
parent ba2a548f8a
commit 5b9d24683a
@@ -19,6 +19,7 @@
package de.steamwar.bausystem.region; package de.steamwar.bausystem.region;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.features.region.RegionCommand; import de.steamwar.bausystem.features.region.RegionCommand;
import de.steamwar.bausystem.region.dynamic.Tile; import de.steamwar.bausystem.region.dynamic.Tile;
import de.steamwar.command.AbstractSWCommand; import de.steamwar.command.AbstractSWCommand;
@@ -40,8 +41,10 @@ public class DynamicRegionCommand extends SWCommand {
SWPlayer swPlayer = SWPlayer.of(player); SWPlayer swPlayer = SWPlayer.of(player);
if (swPlayer.hasComponent(DynamicRegionVisualizer.class)) { if (swPlayer.hasComponent(DynamicRegionVisualizer.class)) {
swPlayer.removeComponent(DynamicRegionVisualizer.class); swPlayer.removeComponent(DynamicRegionVisualizer.class);
} else { } else if (Permission.SUPERVISOR.hasPermission(player)) {
swPlayer.setComponent(new DynamicRegionVisualizer()); swPlayer.setComponent(new DynamicRegionVisualizer());
} else {
// TODO: Add Message
} }
} }
} }