aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder
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/pathfinder
parent89ddd5e85f4f2fb98697df15528df6e07a3ddd07 (diff)
downloadazalea-drasl-a2606569bb79867d07a075bcf7b05730e4264d72.tar.xz
use owned instead of borrowed Vec3 more
Diffstat (limited to 'azalea/src/pathfinder')
-rw-r--r--azalea/src/pathfinder/debug.rs2
-rw-r--r--azalea/src/pathfinder/goals.rs10
-rw-r--r--azalea/src/pathfinder/mod.rs2
3 files changed, 7 insertions, 7 deletions
diff --git a/azalea/src/pathfinder/debug.rs b/azalea/src/pathfinder/debug.rs
index 6b319531..d0d264d3 100644
--- a/azalea/src/pathfinder/debug.rs
+++ b/azalea/src/pathfinder/debug.rs
@@ -65,7 +65,7 @@ pub fn debug_render_path_with_particles(
let start_vec3 = start.center();
let end_vec3 = end.center();
- let step_count = (start_vec3.distance_squared_to(&end_vec3).sqrt() * 4.0) as usize;
+ let step_count = (start_vec3.distance_to(end_vec3) * 4.0) as usize;
let target_block_state = chunks.get_block_state(movement.target).unwrap_or_default();
let above_target_block_state = chunks
diff --git a/azalea/src/pathfinder/goals.rs b/azalea/src/pathfinder/goals.rs
index c19bf504..95786561 100644
--- a/azalea/src/pathfinder/goals.rs
+++ b/azalea/src/pathfinder/goals.rs
@@ -230,16 +230,16 @@ impl Goal for ReachBlockPosGoal {
}
// only do the expensive check if we're close enough
- let distance = self.pos.distance_squared_to(&n);
- if distance > self.max_check_distance.pow(2) {
+ let distance_squared = self.pos.distance_squared_to(n);
+ if distance_squared > self.max_check_distance.pow(2) {
return false;
}
let eye_position = n.center_bottom().up(1.62);
- let look_direction = crate::direction_looking_at(&eye_position, &self.pos.center());
+ let look_direction = crate::direction_looking_at(eye_position, self.pos.center());
let block_hit_result = azalea_client::interact::pick_block(
- &look_direction,
- &eye_position,
+ look_direction,
+ eye_position,
&self.chunk_storage,
self.distance,
);
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index e75c99c4..9786e1de 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -641,7 +641,7 @@ pub fn timeout_movement(
// don't timeout if we're mining
if let Some(mining) = mining {
// also make sure we're close enough to the block that's being mined
- if mining.pos.distance_squared_to(&BlockPos::from(position)) < 6_i32.pow(2) {
+ if mining.pos.distance_squared_to(position.into()) < 6_i32.pow(2) {
// also reset the last_node_reached_at so we don't timeout after we finish
// mining
executing_path.last_node_reached_at = Instant::now();