diff options
| author | mat <git@matdoes.dev> | 2025-06-02 03:14:08 -0430 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-02 03:14:08 -0430 |
| commit | 0569862a1b1f46f1854f4eafd1569359397f2515 (patch) | |
| tree | 01f20f6b078db41d34f08d7f52000f9fb46f7c45 /azalea/benches | |
| parent | d7cd30505954d841f05d85a4cfd74412739778dd (diff) | |
| download | azalea-drasl-0569862a1b1f46f1854f4eafd1569359397f2515.tar.xz | |
fix issues related to pathfinder mining
Diffstat (limited to 'azalea/benches')
| -rw-r--r-- | azalea/benches/pathfinder.rs | 15 | ||||
| -rw-r--r-- | azalea/benches/physics.rs | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/azalea/benches/pathfinder.rs b/azalea/benches/pathfinder.rs index bb4e312a..cddaee2c 100644 --- a/azalea/benches/pathfinder.rs +++ b/azalea/benches/pathfinder.rs @@ -4,6 +4,7 @@ use azalea::{ BlockPos, pathfinder::{ astar::{self, PathfinderTimeout, WeightedNode, a_star}, + custom_state::CustomPathfinderStateRef, goals::{BlockPosGoal, Goal}, mining::MiningCache, rel_block_pos::RelBlockPos, @@ -41,13 +42,13 @@ fn generate_bedrock_world( let mut chunk = chunk.write(); for x in 0..16_u8 { for z in 0..16_u8 { - chunk.set( + chunk.set_block_state( &ChunkBlockPos::new(x, 1, z), azalea_registry::Block::Bedrock.into(), chunks.min_y, ); if rng.gen_bool(0.5) { - chunk.set( + chunk.set_block_state( &ChunkBlockPos::new(x, 2, z), azalea_registry::Block::Bedrock.into(), chunks.min_y, @@ -99,7 +100,7 @@ fn generate_mining_world( for y in chunks.min_y..(chunks.min_y + chunks.height as i32) { for x in 0..16_u8 { for z in 0..16_u8 { - chunk.set( + chunk.set_block_state( &ChunkBlockPos::new(x, y, z), azalea_registry::Block::Stone.into(), chunks.min_y, @@ -134,7 +135,13 @@ fn run_pathfinder_benchmark( let goal = BlockPosGoal(end); let successors = |pos: RelBlockPos| { - azalea::pathfinder::call_successors_fn(&cached_world, &mining_cache, successors_fn, pos) + azalea::pathfinder::call_successors_fn( + &cached_world, + &mining_cache, + &CustomPathfinderStateRef::default(), + successors_fn, + pos, + ) }; let astar::Path { diff --git a/azalea/benches/physics.rs b/azalea/benches/physics.rs index 5eb164d7..2f122014 100644 --- a/azalea/benches/physics.rs +++ b/azalea/benches/physics.rs @@ -25,7 +25,7 @@ fn generate_world(partial_chunks: &mut PartialChunkStorage, size: u32) -> ChunkS let mut chunk = chunk.write(); for x in 0..16_u8 { for z in 0..16_u8 { - chunk.set( + chunk.set_block_state( &ChunkBlockPos::new(x, 1, z), azalea_registry::Block::OakFence.into(), chunks.min_y, |
