Skip to content

Commit b4aa306

Browse files
feat(Catlas): Update all player locations before start
Not sure what to do if the player goes out of view Copy of Skytils/Catlas-Fabric@9fde842
1 parent 4077bb4 commit b4aa306

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/Catlas.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ object Catlas {
101101
it.state = RoomState.PREVISITED
102102
}
103103
}
104-
DungeonListener.team[mc.thePlayer.name]?.mapPlayer?.yaw = mc.thePlayer.rotationYaw
104+
MapUpdater.updatePlayersUsingEntity()
105105
}
106106
}
107107

src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/handlers/MapUpdater.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ object MapUpdater {
5454
}
5555
}
5656

57+
fun updatePlayersUsingEntity() {
58+
DungeonListener.team.forEach { (name, team) ->
59+
team.player?.let {
60+
team.mapPlayer.yaw = it.rotationYaw
61+
team.mapPlayer.mapX =
62+
((it.posX - DungeonScanner.startX + 15) * MapUtils.coordMultiplier + MapUtils.startCorner.first).roundToInt()
63+
team.mapPlayer.mapZ =
64+
((it.posZ - DungeonScanner.startZ + 15) * MapUtils.coordMultiplier + MapUtils.startCorner.second).roundToInt()
65+
}
66+
}
67+
}
68+
5769
fun updateRooms(mapData: MapData) {
5870
DungeonMapColorParser.updateMap(mapData)
5971

0 commit comments

Comments
 (0)