From 2d3e4194b885ec499826812da52c965f5a7235cf Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 27 Mar 2026 13:49:18 -0600 Subject: instant path updates for simple paths, and add follow command to testbot --- azalea/src/pathfinder/execute/simulation.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'azalea/src/pathfinder/execute/simulation.rs') diff --git a/azalea/src/pathfinder/execute/simulation.rs b/azalea/src/pathfinder/execute/simulation.rs index 7287587b..1b010cca 100644 --- a/azalea/src/pathfinder/execute/simulation.rs +++ b/azalea/src/pathfinder/execute/simulation.rs @@ -79,7 +79,7 @@ pub enum SimulatingPathState { Fail, Simulated(SimulatingPathOpts), } -#[derive(Clone, Component, Debug)] +#[derive(Clone, Debug)] pub struct SimulatingPathOpts { pub start: BlockPos, pub target: BlockPos, @@ -89,6 +89,14 @@ pub struct SimulatingPathOpts { pub sprinting: bool, pub y_rot: f32, } +impl SimulatingPathState { + pub fn as_simulated(&self) -> Option<&SimulatingPathOpts> { + match self { + Self::Fail => None, + Self::Simulated(s) => Some(s), + } + } +} #[allow(clippy::type_complexity)] pub fn tick_execute_path( @@ -249,6 +257,8 @@ fn run_simulations( let mut sim = Simulation::new(world_holder.shared.read().chunks.clone(), player.clone()); + // note that we can't skip more than 50 nodes without causing issues with the + // executing_path_limit in goto_listener for nodes_ahead in [20, 15, 10, 5, 4, 3, 2, 1, 0] { if nodes_ahead + 1 >= executing_path.path.len() { // don't simulate to the last node since it has stricter checks -- cgit v1.2.3