Fix issue with chunk corners

This commit is contained in:
AverageGithub 2024-03-12 17:56:56 +01:00
parent e181fa6f77
commit 9bfcb7af2e
2 changed files with 6 additions and 6 deletions

View File

@ -109,7 +109,7 @@ class MinionPlaceListener : Listener {
Minions.isTicking(
chunk
)
}"
} Chunk x: ${chunk.x} z: ${chunk.z} location x: ${location.x} y: ${location.y} z: ${location.z}"
)
}

View File

@ -65,8 +65,8 @@ object Minions {
}
fun load(minion: Minion) {
val chunkX = (Math.round(minion.getLocation().x) shr 4).toInt()
val chunkZ = (Math.round(minion.getLocation().z) shr 4).toInt()
val chunkX = minion.getLocation().blockX shr 4
val chunkZ = minion.getLocation().blockZ shr 4
val world = minion.getLocation().world ?: return
lock.write {
@ -80,7 +80,7 @@ object Minions {
}
}
if (pos === null) {
if (pos == null) {
pos = ChunkPos(world, chunkX, chunkZ, false)
minions.add(pos!!)
}
@ -91,8 +91,8 @@ object Minions {
}
fun remove(minion: Minion) {
val chunkX = (Math.round(minion.getLocation().x) shr 4).toInt()
val chunkZ = (Math.round(minion.getLocation().z) shr 4).toInt()
val chunkX = minion.getLocation().blockX shr 4
val chunkZ = minion.getLocation().blockZ shr 4
val world = minion.getLocation().world ?: return
lock.write {