Fix bits per biome if there is only one biome in the palette

This commit is contained in:
Lukas Rieger (Blue) 2022-10-17 09:18:13 +02:00
parent de5d8a4689
commit 9bc77c7257
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -210,7 +210,7 @@ public Section(CompoundTag sectionData) {
if (skyLight.length < 2048 && skyLight.length > 0) skyLight = Arrays.copyOf(skyLight, 2048);
this.bitsPerBlock = this.blocks.length >> 6; // available longs * 64 (bits per long) / 4096 (blocks per section) (floored result)
this.bitsPerBiome = Integer.SIZE - Integer.numberOfLeadingZeros(this.biomePalette.length - 1);
this.bitsPerBiome = Math.max(1, Integer.SIZE - Integer.numberOfLeadingZeros(this.biomePalette.length - 1));
}
private BlockState readBlockStatePaletteEntry(CompoundTag paletteEntry) {