diff options
| author | mat <git@matdoes.dev> | 2023-09-30 18:18:53 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-09-30 18:18:53 -0500 |
| commit | aee48061cf7ba0db6f3d0bd87b044aeac9490f25 (patch) | |
| tree | e4dc4152053dbefe0667229b96318e0af6b890b6 /azalea | |
| parent | b6358463440abb101303712d8588a710294d3275 (diff) | |
| download | azalea-drasl-aee48061cf7ba0db6f3d0bd87b044aeac9490f25.tar.xz | |
clippy
Diffstat (limited to 'azalea')
| -rw-r--r-- | azalea/src/pathfinder/moves/parkour.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea/src/pathfinder/moves/parkour.rs b/azalea/src/pathfinder/moves/parkour.rs index 2a2f132f..b6a839e6 100644 --- a/azalea/src/pathfinder/moves/parkour.rs +++ b/azalea/src/pathfinder/moves/parkour.rs @@ -23,7 +23,7 @@ pub fn parkour_move(world: &Instance, node: BlockPos) -> Vec<Edge> { fn parkour_forward_1_move(world: &Instance, pos: BlockPos) -> Vec<Edge> { let mut edges = Vec::new(); for dir in CardinalDirection::iter() { - let gap_offset = BlockPos::new(dir.x() * 1, 0, dir.z() * 1); + let gap_offset = BlockPos::new(dir.x(), 0, dir.z()); let offset = BlockPos::new(dir.x() * 2, 0, dir.z() * 2); if !is_standable(&(pos + offset), world) { @@ -64,7 +64,7 @@ fn parkour_forward_1_move(world: &Instance, pos: BlockPos) -> Vec<Edge> { fn parkour_forward_2_move(world: &Instance, pos: BlockPos) -> Vec<Edge> { let mut edges = Vec::new(); for dir in CardinalDirection::iter() { - let gap_1_offset = BlockPos::new(dir.x() * 1, 0, dir.z() * 1); + let gap_1_offset = BlockPos::new(dir.x(), 0, dir.z()); let gap_2_offset = BlockPos::new(dir.x() * 2, 0, dir.z() * 2); let offset = BlockPos::new(dir.x() * 3, 0, dir.z() * 3); @@ -115,7 +115,7 @@ fn parkour_forward_2_move(world: &Instance, pos: BlockPos) -> Vec<Edge> { fn parkour_headhitter_forward_1_move(world: &Instance, pos: BlockPos) -> Vec<Edge> { let mut edges = Vec::new(); for dir in CardinalDirection::iter() { - let gap_offset = BlockPos::new(dir.x() * 1, 0, dir.z() * 1); + let gap_offset = BlockPos::new(dir.x(), 0, dir.z()); let offset = BlockPos::new(dir.x() * 2, 0, dir.z() * 2); if !is_standable(&(pos + offset), world) { @@ -223,8 +223,8 @@ fn execute_headhitter_parkour_move( let start_center = start.center(); let distance_from_start = f64::max( - (start_center.x as f64 - position.x).abs(), - (start_center.z as f64 - position.z).abs(), + (start_center.x - position.x).abs(), + (start_center.z - position.z).abs(), ); if distance_from_start > 0.75 { |
