From 6020a2297fe398a7674c9c5d872614bb09d07e14 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 4 Feb 2025 05:29:18 +0000 Subject: add todo about wrong calculated_bits_per_entry code --- azalea-world/src/palette.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azalea-world/src/palette.rs b/azalea-world/src/palette.rs index c125a4f0..9b1a8642 100755 --- a/azalea-world/src/palette.rs +++ b/azalea-world/src/palette.rs @@ -55,6 +55,9 @@ impl PalettedContainer { // that it'd be global. if it's not global, then we have to calculate it // ourselves. // this almost never matters, except on some custom servers like hypixel limbo + // TODO: this is incorrect. we should be getting the log2 of the max blockstate + // or biome instead of data.len(). this code might be causing wrong data to be + // read. ¯\_(ツ)_/¯ let calculated_bits_per_entry = math::ceil_log2(data.len() as u32) as u8; let calculated_bits_per_entry_palette_kind = PaletteKind::from_bits_and_type(calculated_bits_per_entry, container_type); -- cgit v1.2.3