From de5a53ce08de5b9d77bce99dd9ecde3171ebd74e Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 24 Dec 2024 05:18:33 +0000 Subject: add additional pathfinder test and fix pathfinder failure --- azalea/src/pathfinder/mod.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'azalea/src/pathfinder/mod.rs') diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 802d9ebd..b82b5f84 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -945,6 +945,7 @@ mod tests { // simulation.app.add_plugins(bevy_log::LogPlugin { // level: bevy_log::Level::TRACE, // filter: "".to_string(), + // ..Default::default() // }); simulation.app.world_mut().send_event(GotoEvent { @@ -1153,4 +1154,24 @@ mod tests { ); assert_simulation_reaches(&mut simulation, 80, BlockPos::new(4, 71, 12)); } + + #[test] + fn test_jumps_with_more_sideways_momentum() { + let mut partial_chunks = PartialChunkStorage::default(); + let mut simulation = setup_blockposgoal_simulation( + &mut partial_chunks, + BlockPos::new(0, 71, 0), + BlockPos::new(2, 74, 9), + vec![ + BlockPos::new(0, 70, 0), + BlockPos::new(0, 70, 1), + BlockPos::new(0, 70, 2), + BlockPos::new(0, 71, 3), + BlockPos::new(0, 72, 6), + BlockPos::new(0, 73, 9), + BlockPos::new(2, 73, 9), + ], + ); + assert_simulation_reaches(&mut simulation, 80, BlockPos::new(2, 74, 9)); + } } -- cgit v1.2.3