mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-24 09:11:20 +01:00
Correctly calculate the number of bits-per block for 1.16-chunks
This commit is contained in:
parent
0aa69c7591
commit
63d00073c5
@ -184,7 +184,7 @@ public Section(CompoundTag sectionData) {
|
||||
this.palette = new BlockState[0];
|
||||
}
|
||||
|
||||
this.bitsPerBlock = blocks.length * 64 / 4096; //64 bits per long and 4096 blocks per section
|
||||
this.bitsPerBlock = this.blocks.length >> 6; // available longs * 64 (bits per long) / 4096 (blocks per section) (floored result)
|
||||
}
|
||||
|
||||
public int getSectionY() {
|
||||
|
@ -185,7 +185,7 @@ public Section(CompoundTag sectionData) {
|
||||
this.palette = new BlockState[0];
|
||||
}
|
||||
|
||||
this.bitsPerBlock = blocks.length * 64 / 4096; //64 bits per long and 4096 blocks per section
|
||||
this.bitsPerBlock = this.blocks.length >> 6; // available longs * 64 (bits per long) / 4096 (blocks per section) (floored result)
|
||||
}
|
||||
|
||||
public int getSectionY() {
|
||||
|
@ -185,9 +185,7 @@ public Section(CompoundTag sectionData) {
|
||||
this.palette = new BlockState[0];
|
||||
}
|
||||
|
||||
|
||||
this.bitsPerBlock = 32 - Integer.numberOfLeadingZeros(palette.length - 1);
|
||||
if (this.bitsPerBlock < 4) this.bitsPerBlock = 4;
|
||||
this.bitsPerBlock = this.blocks.length >> 6; // available longs * 64 (bits per long) / 4096 (blocks per section) (floored result)
|
||||
}
|
||||
|
||||
public int getSectionY() {
|
||||
|
Loading…
Reference in New Issue
Block a user