Skip to content

Commit 6020a22

Browse files
committed
add todo about wrong calculated_bits_per_entry code
1 parent 858bec2 commit 6020a22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

azalea-world/src/palette.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ impl PalettedContainer {
5555
// that it'd be global. if it's not global, then we have to calculate it
5656
// ourselves.
5757
// this almost never matters, except on some custom servers like hypixel limbo
58+
// TODO: this is incorrect. we should be getting the log2 of the max blockstate
59+
// or biome instead of data.len(). this code might be causing wrong data to be
60+
// read. ¯\_(ツ)_/¯
5861
let calculated_bits_per_entry = math::ceil_log2(data.len() as u32) as u8;
5962
let calculated_bits_per_entry_palette_kind =
6063
PaletteKind::from_bits_and_type(calculated_bits_per_entry, container_type);

0 commit comments

Comments
 (0)