Skip to content

Commit

Permalink
fix disassemble 1.20 (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsterner authored Jan 1, 2024
1 parent 25a35ba commit de6bc0b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,21 @@ object ShipAssembler {

ship.activeChunksSet.forEach { chunkX, chunkZ ->
val chunk = level.getChunk(chunkX, chunkZ)
for (section in chunk.sections) {
for (sectionIndex in 0 until chunk.sections.size) {
val section = chunk.sections[sectionIndex]

if (section == null || section.hasOnlyAir()) continue

val bottomY = sectionIndex shl 4

for (x in 0..15) {
for (y in 0..15) {
for (z in 0..15) {
val state = section.getBlockState(x, y, z)
if (state.isAir) continue

val realX = (chunkX shl 4) + x
val realY = chunk.minBuildHeight + y
val realY = bottomY + y + level.minBuildHeight
val realZ = (chunkZ shl 4) + z

val inWorldPos = shipToWorld.transformPosition(alloc0.set(realX + 0.5, realY + 0.5, realZ + 0.5)).floor()
Expand Down

0 comments on commit de6bc0b

Please sign in to comment.