diff options
| author | mat <git@matdoes.dev> | 2026-01-06 04:26:29 +0200 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2026-01-05 17:57:54 -0900 |
| commit | 9c2c7c3497a74e80d7186fdcd97ce2518520faa6 (patch) | |
| tree | 3c4984e3a42ecaf4dcc5fa7503d83c734a03477e /azalea/src/pathfinder/moves/basic.rs | |
| parent | 28fe2d21dc03b96baa61c3b142baff3af5b92a76 (diff) | |
| download | azalea-drasl-9c2c7c3497a74e80d7186fdcd97ce2518520faa6.tar.xz | |
pathfinder fixes and api improvements
don't pathfind on magma, fix mining blocks while swimming, fix RadiusGoal heuristic, and add Client::physics, is_executing_path, and is_calculating_path
Diffstat (limited to 'azalea/src/pathfinder/moves/basic.rs')
| -rw-r--r-- | azalea/src/pathfinder/moves/basic.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/azalea/src/pathfinder/moves/basic.rs b/azalea/src/pathfinder/moves/basic.rs index 128a6daf..b0fea827 100644 --- a/azalea/src/pathfinder/moves/basic.rs +++ b/azalea/src/pathfinder/moves/basic.rs @@ -53,6 +53,7 @@ fn forward_move(ctx: &mut PathfinderCtx, pos: RelBlockPos) { fn execute_forward_move(mut ctx: ExecuteCtx) { let center = ctx.target.center(); + ctx.jump_if_in_water(); if ctx.mine_while_at_start(ctx.target.up(1)) { return; @@ -62,7 +63,6 @@ fn execute_forward_move(mut ctx: ExecuteCtx) { } ctx.look_at(center); - ctx.jump_if_in_water(); ctx.sprint(SprintDirection::Forward); } @@ -135,6 +135,8 @@ fn execute_ascend_move(mut ctx: ExecuteCtx) { .. } = ctx; + ctx.jump_if_in_water(); + if ctx.mine_while_at_start(start.up(2)) { return; } @@ -149,7 +151,6 @@ fn execute_ascend_move(mut ctx: ExecuteCtx) { ctx.look_at(target_center); ctx.walk(WalkDirection::Forward); - ctx.jump_if_in_water(); // these checks are to make sure we don't fall if our velocity is too high in // the wrong direction @@ -461,9 +462,10 @@ fn diagonal_move(ctx: &mut PathfinderCtx, pos: RelBlockPos) { fn execute_diagonal_move(mut ctx: ExecuteCtx) { let target_center = ctx.target.center(); + ctx.jump_if_in_water(); + ctx.look_at(target_center); ctx.sprint(SprintDirection::Forward); - ctx.jump_if_in_water(); } /// Go directly down, usually by mining. |
