Closed prydin closed 5 years ago
Ah yes, I faced this problem already some time ago in the MCASelector but didn't think this would be a problem here. I'll fix that this weekend.
I added an extra check for sections that have a Y index outside of 0-15 and a check for palette content. Empty sections like those added by Minecraft will be treated as non-existent.
The changes are currently available with the latest commit on the master branch, if everything works fine i'll make a release.
I uncovered another issue. Sometimes you have a valid index, but the section is still empty (or at least missing the Palette). Here's how I addressed that:
Yes, I also addressed this issue, see https://github.com/Querz/NBT/blob/master/src/main/java/net/querz/nbt/mca/Section.java#L21 If a Section is missing the Palette, it will be "empty" and won't be added to the chunk: https://github.com/Querz/NBT/blob/master/src/main/java/net/querz/nbt/mca/Chunk.java#L75
With Minecraft 1.14, there are sometimes empty sections in the chunks. They look something like this:
Not sure why they appear, but they should be handled gracefully.
The code in
Chunk.deserialize()
tries to create a new Section here: https://github.com/Querz/NBT/blob/8cedf1e24d65f2e857f42e88453c7161ab53db38/src/main/java/net/querz/nbt/mca/Chunk.java#L76...but fails on a NullPointerException in the Section constructor since there's no
Palette
member here: https://github.com/Querz/NBT/blob/8cedf1e24d65f2e857f42e88453c7161ab53db38/src/main/java/net/querz/nbt/mca/Section.java#L21