From 21e7481a1a79501450a5aaf0e72d162314a8a606 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Sun, 17 Dec 2023 06:33:18 +0000 Subject: [PATCH] feat: add debug view for selection --- .../desti/ShowDestiSubCommand.java | 4 +--- .../portal/ShowPortalSubCommand.java | 22 +++++++++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java index f5bc3610..b540933d 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java @@ -83,7 +83,7 @@ public void registered() { for(PlayerContainer player : serverContainer.getPlayers()) { var tempData = tempDataServices.getPlayerTempData(player); if(!tempData.isDestiVisible()) { - return; + continue; } for (Destination destination : destinationServices.getDestinations()) { @@ -92,8 +92,6 @@ public void registered() { Debug.addMarker(player, pos.toBlockPos(), destination.getArgValues("name")[0], new Color(100, 100, 100, 100), 1000); } } - //Debug.addMarker(player, pos, "", new Color(255, 0, 0, 100), 1000 * 10); - } }, 1, 20); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java index 6d0fe5ee..fabf24bd 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java @@ -6,10 +6,14 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContainer; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; import com.sekwah.advancedportals.core.connector.containers.ServerContainer; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; +import com.sekwah.advancedportals.core.serializeddata.PlayerTempData; import com.sekwah.advancedportals.core.services.PortalTempDataServices; +import com.sekwah.advancedportals.core.util.Debug; import com.sekwah.advancedportals.core.util.GameScheduler; import com.sekwah.advancedportals.core.util.Lang; +import java.awt.*; import java.util.List; /** @@ -70,21 +74,15 @@ public void registered() { gameScheduler.intervalTickEvent("show_portal", () -> { for(PlayerContainer player : serverContainer.getPlayers()) { var tempData = tempDataServices.getPlayerTempData(player); - if(!tempData.isDestiVisible()) { - return; + if(!tempData.isPortalVisible()) { + continue; } - - } - /*sender.sendMessage("Debug"); - if(sender.getPlayerContainer() != null) { - PlayerContainer playerContainer = sender.getPlayerContainer(); - PlayerTempData tempData = tempDataServices.getPlayerTempData(playerContainer); if(tempData.getPos1() != null) { - Debug.addMarker(sender.getPlayerContainer(), tempData.getPos1(), "Pos1", new Color(0, 255, 0), 1000 * 10); + Debug.addMarker(player, tempData.getPos1(), "Pos1", new Color(0, 255, 0), 1000); } if(tempData.getPos2() != null) { - Debug.addMarker(sender.getPlayerContainer(), tempData.getPos2(), "Pos2", new Color(255, 0, 0), 1000 * 10); + Debug.addMarker(player, tempData.getPos2(), "Pos2", new Color(255, 0, 0), 1000); } if (tempData.getPos1() != null && tempData.getPos2() != null) { @@ -106,13 +104,13 @@ public void registered() { var pos = new BlockLocation(tempData.getPos1().worldName, x, y, z); if (pos.equals(tempData.getPos1()) || pos.equals(tempData.getPos2())) continue; - Debug.addMarker(sender.getPlayerContainer(), pos, "", new Color(255, 0, 0, 100), 1000 * 10); + Debug.addMarker(player, pos, "", new Color(255, 0, 0, 100), 1000); } } } } } - }*/ + } }, 1, 20); } }