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 | |
| parent | 89ddd5e85f4f2fb98697df15528df6e07a3ddd07 (diff) | |
| download | azalea-drasl-a2606569bb79867d07a075bcf7b05730e4264d72.tar.xz | |
use owned instead of borrowed Vec3 more
Diffstat (limited to 'azalea-client/src/plugins')
| -rw-r--r-- | azalea-client/src/plugins/interact.rs | 14 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/game/mod.rs | 4 |
2 files changed, 9 insertions, 9 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, diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index b2a4abc4..e1477d21 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -428,7 +428,7 @@ impl GamePacketHandler<'_> { p.relative .apply(&p.change, &mut position, &mut direction, &mut physics); // old_pos is set to the current position when we're teleported - physics.set_old_pos(&position); + physics.set_old_pos(*position); // send the relevant packets commands.trigger(SendPacketEvent::new( @@ -828,7 +828,7 @@ impl GamePacketHandler<'_> { &mut physics, ); // old_pos is set to the current position when we're teleported - physics.set_old_pos(&old_position); + physics.set_old_pos(old_position); }); }, )); |
