diff options
| author | mat <git@matdoes.dev> | 2025-06-11 22:58:41 -0630 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-11 22:58:41 -0630 |
| commit | a2606569bb79867d07a075bcf7b05730e4264d72 (patch) | |
| tree | fb97fb52aa0c4d7575f6bd5e4e36c2f01c87f942 /azalea-client/src/plugins/interact.rs | |
| parent | 89ddd5e85f4f2fb98697df15528df6e07a3ddd07 (diff) | |
| download | azalea-drasl-a2606569bb79867d07a075bcf7b05730e4264d72.tar.xz | |
use owned instead of borrowed Vec3 more
Diffstat (limited to 'azalea-client/src/plugins/interact.rs')
| -rw-r--r-- | azalea-client/src/plugins/interact.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/azalea-client/src/plugins/interact.rs b/azalea-client/src/plugins/interact.rs index 31b5acf4..d91597d6 100644 --- a/azalea-client/src/plugins/interact.rs +++ b/azalea-client/src/plugins/interact.rs @@ -363,7 +363,7 @@ pub fn update_hit_result_component( }; let instance = instance_lock.read(); - let hit_result = pick(look_direction, &eye_position, &instance.chunks, pick_range); + let hit_result = pick(*look_direction, eye_position, &instance.chunks, pick_range); if let Some(mut hit_result_ref) = hit_result_ref { **hit_result_ref = hit_result; } else { @@ -384,8 +384,8 @@ pub fn update_hit_result_component( /// /// TODO: does not currently check for entities pub fn pick( - look_direction: &LookDirection, - eye_position: &Vec3, + look_direction: LookDirection, + eye_position: Vec3, chunks: &azalea_world::ChunkStorage, pick_range: f64, ) -> HitResult { @@ -400,18 +400,18 @@ pub fn pick( /// /// Also see [`pick`]. pub fn pick_block( - look_direction: &LookDirection, - eye_position: &Vec3, + look_direction: LookDirection, + eye_position: Vec3, chunks: &azalea_world::ChunkStorage, pick_range: f64, ) -> BlockHitResult { let view_vector = view_vector(look_direction); - let end_position = eye_position + &(view_vector * pick_range); + let end_position = eye_position + (view_vector * pick_range); azalea_physics::clip::clip( chunks, ClipContext { - from: *eye_position, + from: eye_position, to: end_position, block_shape_type: BlockShapeType::Outline, fluid_pick_type: FluidPickType::None, |
