diff options
| author | Ubuntu <github@matdoes.dev> | 2023-02-10 01:56:45 +0000 |
|---|---|---|
| committer | Ubuntu <github@matdoes.dev> | 2023-02-10 01:56:45 +0000 |
| commit | 9d4f738d4e66adf0796e163d1c9368aaba906bba (patch) | |
| tree | ae7b3c7fca0ff054eb67c1311955e9321a37e559 /azalea-world/src/chunk_storage.rs | |
| parent | 48b2a37aa09f0302b40d0678cdde2703f919ed18 (diff) | |
| download | azalea-drasl-9d4f738d4e66adf0796e163d1c9368aaba906bba.tar.xz | |
make blockstate good
Diffstat (limited to 'azalea-world/src/chunk_storage.rs')
| -rwxr-xr-x | azalea-world/src/chunk_storage.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index 734dfe29..c2a72ea2 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -343,20 +343,20 @@ impl Section { .states .get(pos.x as usize, pos.y as usize, pos.z as usize); // if there's an unknown block assume it's air - BlockState::try_from(state).unwrap_or(BlockState::Air) + BlockState::try_from(state).unwrap_or(BlockState::AIR) } fn get_and_set(&mut self, pos: ChunkSectionBlockPos, state: BlockState) -> BlockState { let previous_state = self.states - .get_and_set(pos.x as usize, pos.y as usize, pos.z as usize, state as u32); + .get_and_set(pos.x as usize, pos.y as usize, pos.z as usize, state.id); // if there's an unknown block assume it's air - BlockState::try_from(previous_state).unwrap_or(BlockState::Air) + BlockState::try_from(previous_state).unwrap_or(BlockState::AIR) } fn set(&mut self, pos: ChunkSectionBlockPos, state: BlockState) { self.states - .set(pos.x as usize, pos.y as usize, pos.z as usize, state as u32); + .set(pos.x as usize, pos.y as usize, pos.z as usize, state.id); } } |
