forked from SteamWar/SteamWar
Add CArea, RInteractionCallback
Add DynamicRegionEditor, DynamicRegionVisualizer
This commit is contained in:
+5
-5
@@ -36,15 +36,15 @@ public class DynamicRegionCommand extends SWCommand {
|
||||
|
||||
@Register({"dynamic"})
|
||||
public void visualizeRegions(Player player) {
|
||||
Tile tile = Tile.fromLocation(player.getLocation()).orElse(null);
|
||||
if (tile == null) return;
|
||||
SWPlayer swPlayer = SWPlayer.of(player);
|
||||
if (swPlayer.hasComponent(DynamicRegionVisualizer.class)) {
|
||||
swPlayer.removeComponent(DynamicRegionVisualizer.class);
|
||||
} else if (Permission.SUPERVISOR.hasPermission(player)) {
|
||||
swPlayer.setComponent(new DynamicRegionVisualizer());
|
||||
swPlayer.removeComponent(DynamicRegionEditor.class);
|
||||
} else {
|
||||
// TODO: Add Message
|
||||
swPlayer.setComponent(DynamicRegionVisualizer.INSTANCE);
|
||||
if (Permission.SUPERVISOR.hasPermission(player)) {
|
||||
swPlayer.setComponent(new DynamicRegionEditor(player.getPlayer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user