diff options
| author | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2025-03-07 23:57:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-07 23:57:05 -0500 |
| commit | 15f2255c78e65e5b930177e809feff4199932851 (patch) | |
| tree | fb5201576183a20074015b4be2e761e9a4ab353a /src/main/java/de | |
| parent | ea6944c47a4058fdbbc44cda63d5be323055b391 (diff) | |
| download | Skyblocker-15f2255c78e65e5b930177e809feff4199932851.tar.gz Skyblocker-15f2255c78e65e5b930177e809feff4199932851.tar.bz2 Skyblocker-15f2255c78e65e5b930177e809feff4199932851.zip | |
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>
Diffstat (limited to 'src/main/java/de')
| -rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java | 18 |
1 files changed, 13 insertions, 5 deletions
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; |
