Skip to content

Commit 9bc77c7

Browse files
committed
Fix bits per biome if there is only one biome in the palette
1 parent de5d8a4 commit 9bc77c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/ChunkAnvil118.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public Section(CompoundTag sectionData) {
210210
if (skyLight.length < 2048 && skyLight.length > 0) skyLight = Arrays.copyOf(skyLight, 2048);
211211

212212
this.bitsPerBlock = this.blocks.length >> 6; // available longs * 64 (bits per long) / 4096 (blocks per section) (floored result)
213-
this.bitsPerBiome = Integer.SIZE - Integer.numberOfLeadingZeros(this.biomePalette.length - 1);
213+
this.bitsPerBiome = Math.max(1, Integer.SIZE - Integer.numberOfLeadingZeros(this.biomePalette.length - 1));
214214
}
215215

216216
private BlockState readBlockStatePaletteEntry(CompoundTag paletteEntry) {

0 commit comments

Comments
 (0)