aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2023-02-10 01:56:45 +0000
committerUbuntu <github@matdoes.dev>2023-02-10 01:56:45 +0000
commit9d4f738d4e66adf0796e163d1c9368aaba906bba (patch)
treeae7b3c7fca0ff054eb67c1311955e9321a37e559 /azalea-world/src
parent48b2a37aa09f0302b40d0678cdde2703f919ed18 (diff)
downloadazalea-drasl-9d4f738d4e66adf0796e163d1c9368aaba906bba.tar.xz
make blockstate good
Diffstat (limited to 'azalea-world/src')
-rwxr-xr-xazalea-world/src/chunk_storage.rs8
-rw-r--r--azalea-world/src/entity/metadata.rs2
-rw-r--r--azalea-world/src/entity/mod.rs2
3 files changed, 6 insertions, 6 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);
}
}
diff --git a/azalea-world/src/entity/metadata.rs b/azalea-world/src/entity/metadata.rs
index c95d8c3a..3d6c52c8 100644
--- a/azalea-world/src/entity/metadata.rs
+++ b/azalea-world/src/entity/metadata.rs
@@ -2368,7 +2368,7 @@ impl Default for EndermanMetadataBundle {
},
},
},
- carry_state: CarryState(BlockState::Air),
+ carry_state: CarryState(BlockState::AIR),
creepy: Creepy(false),
stared_at: StaredAt(false),
}
diff --git a/azalea-world/src/entity/mod.rs b/azalea-world/src/entity/mod.rs
index 0d0449ac..9b1191fb 100644
--- a/azalea-world/src/entity/mod.rs
+++ b/azalea-world/src/entity/mod.rs
@@ -94,7 +94,7 @@ pub fn on_pos(offset: f32, chunk_storage: &ChunkStorage, pos: &Position) -> Bloc
// TODO: check if block below is a fence, wall, or fence gate
let block_pos = pos.down(1);
let block_state = chunk_storage.get_block_state(&block_pos);
- if block_state == Some(BlockState::Air) {
+ if block_state == Some(BlockState::AIR) {
let block_pos_below = block_pos.down(1);
let block_state_below = chunk_storage.get_block_state(&block_pos_below);
if let Some(_block_state_below) = block_state_below {