diff options
| author | mat <github@matdoes.dev> | 2022-06-17 15:59:27 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-17 15:59:27 -0500 |
| commit | 69e1125ecbb3e695125b8e65deba3e3f7be41b70 (patch) | |
| tree | 92821e0b3a1afc2145798757117478920bae3d10 /azalea-world/src/lib.rs | |
| parent | 74c3ae52f84d988b8bf3f0affe143d2cd2d8143a (diff) | |
| download | azalea-drasl-69e1125ecbb3e695125b8e65deba3e3f7be41b70.tar.xz | |
Slightly improve bit storage
Diffstat (limited to 'azalea-world/src/lib.rs')
| -rw-r--r-- | azalea-world/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs index 8777c0a3..26566416 100644 --- a/azalea-world/src/lib.rs +++ b/azalea-world/src/lib.rs @@ -205,12 +205,15 @@ pub struct Section { impl McBufReadable for Section { fn read_into(buf: &mut impl Read) -> Result<Self, String> { let block_count = u16::read_into(buf)?; + // this is commented out because the vanilla server is wrong // assert!( // block_count <= 16 * 16 * 16, // "A section has more blocks than what should be possible. This is a bug!" // ); + let states = PalettedContainer::read_with_type(buf, &PalettedContainerType::BlockStates)?; + for i in 0..states.storage.size() { if !BlockState::is_valid_state(states.storage.get(i) as u32) { return Err(format!( @@ -219,6 +222,7 @@ impl McBufReadable for Section { )); } } + let biomes = PalettedContainer::read_with_type(buf, &PalettedContainerType::Biomes)?; Ok(Section { block_count, |
