From 9c2c7c3497a74e80d7186fdcd97ce2518520faa6 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 6 Jan 2026 04:26:29 +0200 Subject: 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 --- azalea/src/pathfinder/moves/basic.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'azalea/src/pathfinder/moves/basic.rs') 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. -- cgit v1.2.3