diff options
| author | mat <git@matdoes.dev> | 2026-01-19 10:54:20 -1345 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2026-01-20 03:39:24 +0300 |
| commit | 043b010acaab5a4faf76b8b6574bfcde9ec26d94 (patch) | |
| tree | 3a1ff04783cdaf151b8dca0fa63f011e91363f9f /azalea-world/src | |
| parent | f850752e056449e49cf805fc4261b252a357b11d (diff) | |
| download | azalea-drasl-043b010acaab5a4faf76b8b6574bfcde9ec26d94.tar.xz | |
remove check for block_count and add relevant comment
Diffstat (limited to 'azalea-world/src')
| -rw-r--r-- | azalea-world/src/chunk_storage.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index e170dc83..23da5af5 100644 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -81,6 +81,11 @@ pub struct Chunk { /// A section of a chunk, i.e. a 16*16*16 block area. #[derive(Clone, Debug, Default)] pub struct Section { + /// The number of non-empty blocks in the section, as sent to us by the + /// server. + /// + /// Currently, Azalea does not update this on its own, so it may become out + /// of sync. pub block_count: u16, pub states: PalettedContainer<BlockState>, pub biomes: PalettedContainer<Biome>, @@ -457,9 +462,7 @@ pub fn get_block_state_from_sections( return None; }; let section = §ions[section_index]; - if section.block_count == 0 { - return Some(BlockState::AIR); - } + let chunk_section_pos = ChunkSectionBlockPos::from(pos); Some(section.get_block_state(chunk_section_pos)) } |
