Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Valid .mca files can have sections outside of 0..15, print a warning …
Browse files Browse the repository at this point in the history
…and move on
  • Loading branch information
jglrxavpok committed Jul 6, 2020
1 parent 6f4513d commit d7a077b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/kotlin/org/jglrxavpok/hephaistos/mca/ChunkColumn.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ class ChunkColumn(val x: Int, val z: Int) {
val sectionsNBT = level.getList<NBTCompound>("Sections") ?: missing("Sections")
for(nbt in sectionsNBT) {
val sectionY = nbt.getByte("Y") ?: missing("Y")
if(sectionY == (-1).toByte()) { // mark that they are empty sections?
continue
}
if(sectionY !in 0..15) {
throw AnvilException("Invalid Y value for section: $sectionY. Must be in 0..15")
System.err.println("[Hephaistos] Invalid Y value for section: $sectionY. Must be in 0..15, ignoring.")
} else {
sections[sectionY.toInt()] = ChunkSection(nbt)
}
sections[sectionY.toInt()] = ChunkSection(nbt)
}
}

Expand Down

0 comments on commit d7a077b

Please sign in to comment.