Fix render-issue if section it fully made of air

This commit is contained in:
Lukas Rieger (Blue) 2022-10-21 21:41:47 +02:00
parent faa6965df3
commit ad4ae53672
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
2 changed files with 2 additions and 10 deletions

View File

@ -66,14 +66,6 @@ public class ChunkAnvil118 extends MCAChunk {
for (CompoundTag sectionTag : sectionsTag) {
// skip empty sections
CompoundTag blockStatesTag = sectionTag.getCompoundTag("block_states");
if (blockStatesTag == null) continue;
ListTag<CompoundTag> paletteTag = (ListTag<CompoundTag>) blockStatesTag.getListTag("palette");
if (paletteTag == null) continue;
if (paletteTag.size() == 0) continue;
if (paletteTag.size() == 1 && BlockState.AIR.getFormatted().equals(paletteTag.get(0).getString("Name"))) continue;
Section section = new Section(sectionTag);
int y = section.getSectionY();

View File

@ -62,7 +62,7 @@ public class MCARegion implements Region {
int xzChunk = Math.floorMod(chunkZ, 32) * 32 + Math.floorMod(chunkX, 32);
raf.seek(xzChunk * 4);
raf.seek(xzChunk * 4L);
int offset = raf.read() << 16;
offset |= (raf.read() & 0xFF) << 8;
offset |= raf.read() & 0xFF;
@ -125,7 +125,7 @@ public class MCARegion implements Region {
}
}
} catch (RuntimeException | IOException ex) {
Logger.global.logWarning("Failed to read .mca file: " + regionFile.getAbsolutePath() + " (" + ex.toString() + ")");
Logger.global.logWarning("Failed to read .mca file: " + regionFile.getAbsolutePath() + " (" + ex + ")");
}
return chunks;