From 15f2255c78e65e5b930177e809feff4199932851 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Fri, 7 Mar 2025 23:57:05 -0500 Subject: Fix dungeon entrance room physical pos being detected incorrectly (#1200) * Fix dungeon entrance room physical pos being detected incorrectly * Refactor physical entrance pos detection --------- Co-authored-by: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> --- .../skyblock/dungeon/secrets/DungeonManager.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java index 52a1433e..63e71abe 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java @@ -565,11 +565,19 @@ public class DungeonManager { if (client.player == null || client.world == null) { return; } - if (physicalEntrancePos == null) { - Vec3d playerPos = client.player.getPos(); - physicalEntrancePos = DungeonMapUtils.getPhysicalRoomPos(playerPos); - currentRoom = newRoom(Room.Type.ENTRANCE, physicalEntrancePos); - } + + if (physicalEntrancePos == null) { + //The check for the area should delay this until after the player's position has been set by the server (since the scoreboard should be sent after the player position) + //this is necessary otherwise the default position of (0, 0) or whatever will mess up the entrance calculation which will break all sorts of things + if (!Utils.getIslandArea().contains("The Catacombs")) { + return; + } + + Vec3d playerPos = client.player.getPos(); + physicalEntrancePos = DungeonMapUtils.getPhysicalRoomPos(playerPos); + currentRoom = newRoom(Room.Type.ENTRANCE, physicalEntrancePos); + } + MapState map = FilledMapItem.getMapState(DungeonMap.getMapIdComponent(client.player.getInventory().main.get(8)), client.world); if (map == null) { return; -- cgit