From 1be6f32c6dcea88896e6b6dcf57711d8d85474c5 Mon Sep 17 00:00:00 2001 From: suprohub Date: Mon, 6 Jan 2025 10:31:15 +0400 Subject: [PATCH] fixes --- pumpkin-world/src/chunk/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pumpkin-world/src/chunk/mod.rs b/pumpkin-world/src/chunk/mod.rs index 2eb1b85a..a773a4b6 100644 --- a/pumpkin-world/src/chunk/mod.rs +++ b/pumpkin-world/src/chunk/mod.rs @@ -258,11 +258,12 @@ impl Subchunks { match self { Self::Single(block) => { if *block != new_block { - *self = Self::Multi( - vec![Subchunk::Single(0); SUBCHUNKS_COUNT] - .try_into() - .unwrap(), - ) + let mut subchunks = vec![Subchunk::Single(0); SUBCHUNKS_COUNT]; + + subchunks[(position.y.get_absolute() / 16) as usize] + .set_block(position, new_block); + + *self = Self::Multi(subchunks.try_into().unwrap()); } } Self::Multi(subchunks) => {