diff options
| author | mat <github@matdoes.dev> | 2022-06-17 16:27:58 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-17 16:27:58 -0500 |
| commit | d0fc7d0eff32687d7210b730584db2c3faa055ae (patch) | |
| tree | 8cbc9930a045d12c4eedd2b5af815f7c795f34d2 /azalea-world/src/lib.rs | |
| parent | 69e1125ecbb3e695125b8e65deba3e3f7be41b70 (diff) | |
| download | azalea-drasl-d0fc7d0eff32687d7210b730584db2c3faa055ae.tar.xz | |
ClientboundSetEquipmentPacket
Diffstat (limited to 'azalea-world/src/lib.rs')
| -rw-r--r-- | azalea-world/src/lib.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs index 26566416..e651e455 100644 --- a/azalea-world/src/lib.rs +++ b/azalea-world/src/lib.rs @@ -4,11 +4,11 @@ mod bit_storage; mod palette; use crate::palette::PalettedContainerType; +use azalea_block::BlockState; use azalea_core::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos}; use azalea_protocol::mc_buf::{McBufReadable, McBufWritable}; pub use bit_storage::BitStorage; use palette::PalettedContainer; -use azalea_block::BlockState; use std::{ io::{Read, Write}, ops::{Index, IndexMut}, @@ -218,7 +218,8 @@ impl McBufReadable for Section { if !BlockState::is_valid_state(states.storage.get(i) as u32) { return Err(format!( "Invalid block state {} (index {}) found in section.", - states.storage.get(i), i + states.storage.get(i), + i )); } } @@ -245,6 +246,8 @@ impl Section { fn get(&self, pos: ChunkSectionBlockPos) -> BlockState { // TODO: use the unsafe method and do the check earlier self.states - .get(pos.x as usize, pos.y as usize, pos.z as usize).try_into().expect("Invalid block state.") + .get(pos.x as usize, pos.y as usize, pos.z as usize) + .try_into() + .expect("Invalid block state.") } } |
