aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-04 05:29:18 +0000
committermat <git@matdoes.dev>2025-02-04 05:29:18 +0000
commit6020a2297fe398a7674c9c5d872614bb09d07e14 (patch)
tree2f34e9547c7c36afc3f8973b9f65ce7f6f0327a8
parent858bec2081451a1926c2139c59bb7be8725b4d9a (diff)
downloadazalea-drasl-6020a2297fe398a7674c9c5d872614bb09d07e14.tar.xz
add todo about wrong calculated_bits_per_entry code
-rwxr-xr-xazalea-world/src/palette.rs3
1 files changed, 3 insertions, 0 deletions
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);