diff options
| author | mat <git@matdoes.dev> | 2025-06-11 16:55:33 +1100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-11 16:55:33 +1100 |
| commit | 9b0bd29db4faa9d94df0cec472346b814e7efcb9 (patch) | |
| tree | 4f681b5143eb5ebe69a0b5b53125ea7509f8026a /azalea-physics/src/fluids.rs | |
| parent | 2a6ac0764fe9975f9b16d495ce773e4ae1f097e0 (diff) | |
| download | azalea-drasl-9b0bd29db4faa9d94df0cec472346b814e7efcb9.tar.xz | |
take BlockPos instead of &BlockPos in all function arguments
Diffstat (limited to 'azalea-physics/src/fluids.rs')
| -rw-r--r-- | azalea-physics/src/fluids.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-physics/src/fluids.rs b/azalea-physics/src/fluids.rs index c4716a27..5ea6194a 100644 --- a/azalea-physics/src/fluids.rs +++ b/azalea-physics/src/fluids.rs @@ -116,7 +116,7 @@ fn update_fluid_height_and_do_fluid_pushing( for cur_y in min_y..max_y { for cur_z in min_z..max_z { let cur_pos = BlockPos::new(cur_x, cur_y, cur_z); - let Some(fluid_at_cur_pos) = world.get_fluid_state(&cur_pos) else { + let Some(fluid_at_cur_pos) = world.get_fluid_state(cur_pos) else { continue; }; if fluid_at_cur_pos.kind != checking_fluid { @@ -192,7 +192,7 @@ pub fn get_fluid_flow(fluid: &FluidState, world: &Instance, pos: BlockPos) -> Ve let adjacent_block_pos = pos.offset_with_direction(direction); let adjacent_block_state = world - .get_block_state(&adjacent_block_pos) + .get_block_state(adjacent_block_pos) .unwrap_or_default(); let adjacent_fluid_state = FluidState::from(adjacent_block_state); @@ -206,7 +206,7 @@ pub fn get_fluid_flow(fluid: &FluidState, world: &Instance, pos: BlockPos) -> Ve if !legacy_blocks_motion(adjacent_block_state) { let block_pos_below_adjacent = adjacent_block_pos.down(1); let fluid_below_adjacent = world - .get_fluid_state(&block_pos_below_adjacent) + .get_fluid_state(block_pos_below_adjacent) .unwrap_or_default(); if fluid.affects_flow(&fluid_below_adjacent) { @@ -250,8 +250,8 @@ fn is_solid_face( adjacent_pos: BlockPos, direction: Direction, ) -> bool { - let block_state = world.get_block_state(&adjacent_pos).unwrap_or_default(); - let fluid_state = world.get_fluid_state(&adjacent_pos).unwrap_or_default(); + let block_state = world.get_block_state(adjacent_pos).unwrap_or_default(); + let fluid_state = world.get_fluid_state(adjacent_pos).unwrap_or_default(); if fluid_state.is_same_kind(fluid) { return false; } |
