aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/nearest_entity.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-06-11 22:58:41 -0630
committermat <git@matdoes.dev>2025-06-11 22:58:41 -0630
commita2606569bb79867d07a075bcf7b05730e4264d72 (patch)
treefb97fb52aa0c4d7575f6bd5e4e36c2f01c87f942 /azalea/src/nearest_entity.rs
parent89ddd5e85f4f2fb98697df15528df6e07a3ddd07 (diff)
downloadazalea-drasl-a2606569bb79867d07a075bcf7b05730e4264d72.tar.xz
use owned instead of borrowed Vec3 more
Diffstat (limited to 'azalea/src/nearest_entity.rs')
-rw-r--r--azalea/src/nearest_entity.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea/src/nearest_entity.rs b/azalea/src/nearest_entity.rs
index 7ac4fff0..df54273a 100644
--- a/azalea/src/nearest_entity.rs
+++ b/azalea/src/nearest_entity.rs
@@ -69,7 +69,7 @@ where
/// multiple entities are within range, only the closest one is returned.
pub fn nearest_to_position(
&'a self,
- position: &Position,
+ position: Position,
instance_name: &InstanceName,
max_distance: f64,
) -> Option<Entity> {
@@ -81,7 +81,7 @@ where
continue;
}
- let target_distance = position.distance_to(e_pos);
+ let target_distance = position.distance_to(**e_pos);
if target_distance < min_distance {
nearest_entity = Some(target_entity);
min_distance = target_distance;
@@ -111,7 +111,7 @@ where
continue;
}
- let target_distance = position.distance_to(e_pos);
+ let target_distance = position.distance_to(**e_pos);
if target_distance < min_distance {
nearest_entity = Some(target_entity);
min_distance = target_distance;
@@ -140,7 +140,7 @@ where
return None;
}
- let distance = position.distance_to(e_pos);
+ let distance = position.distance_to(**e_pos);
if distance < max_distance {
Some((target_entity, distance))
} else {
@@ -181,7 +181,7 @@ where
return None;
}
- let distance = position.distance_to(e_pos);
+ let distance = position.distance_to(**e_pos);
if distance < max_distance {
Some((target_entity, distance))
} else {