diff options
| author | mat <git@matdoes.dev> | 2025-06-11 16:55:33 +1100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-11 16:55:33 +1100 |
| commit | 9b0bd29db4faa9d94df0cec472346b814e7efcb9 (patch) | |
| tree | 4f681b5143eb5ebe69a0b5b53125ea7509f8026a /azalea/src/pathfinder | |
| parent | 2a6ac0764fe9975f9b16d495ce773e4ae1f097e0 (diff) | |
| download | azalea-drasl-9b0bd29db4faa9d94df0cec472346b814e7efcb9.tar.xz | |
take BlockPos instead of &BlockPos in all function arguments
Diffstat (limited to 'azalea/src/pathfinder')
| -rw-r--r-- | azalea/src/pathfinder/debug.rs | 4 | ||||
| -rw-r--r-- | azalea/src/pathfinder/mod.rs | 4 | ||||
| -rw-r--r-- | azalea/src/pathfinder/moves/mod.rs | 6 | ||||
| -rw-r--r-- | azalea/src/pathfinder/world.rs | 16 |
4 files changed, 15 insertions, 15 deletions
diff --git a/azalea/src/pathfinder/debug.rs b/azalea/src/pathfinder/debug.rs index b00e4272..6b319531 100644 --- a/azalea/src/pathfinder/debug.rs +++ b/azalea/src/pathfinder/debug.rs @@ -67,9 +67,9 @@ pub fn debug_render_path_with_particles( let step_count = (start_vec3.distance_squared_to(&end_vec3).sqrt() * 4.0) as usize; - let target_block_state = chunks.get_block_state(&movement.target).unwrap_or_default(); + let target_block_state = chunks.get_block_state(movement.target).unwrap_or_default(); let above_target_block_state = chunks - .get_block_state(&movement.target.up(1)) + .get_block_state(movement.target.up(1)) .unwrap_or_default(); // this isn't foolproof, there might be another block that could be mined // depending on the move, but it's good enough for debugging diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index c4586d29..c72573f5 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -1334,10 +1334,10 @@ mod tests { partial_chunks.set(&chunk_pos, Some(Chunk::default()), &mut chunks); } for block_pos in solid_blocks { - chunks.set_block_state(block_pos, azalea_registry::Block::Stone.into()); + chunks.set_block_state(*block_pos, azalea_registry::Block::Stone.into()); } for (block_pos, block_state) in extra_blocks { - chunks.set_block_state(block_pos, *block_state); + chunks.set_block_state(*block_pos, *block_state); } let player = SimulatedPlayerBundle::new(Vec3::new( diff --git a/azalea/src/pathfinder/moves/mod.rs b/azalea/src/pathfinder/moves/mod.rs index 44d31bfb..6d1c7c55 100644 --- a/azalea/src/pathfinder/moves/mod.rs +++ b/azalea/src/pathfinder/moves/mod.rs @@ -122,7 +122,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_> { let block_state = self .instance .read() - .get_block_state(&block) + .get_block_state(block) .unwrap_or_default(); if is_block_state_passable(block_state) { // block is already passable, no need to mine it @@ -138,7 +138,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_> { let block_state = self .instance .read() - .get_block_state(&block) + .get_block_state(block) .unwrap_or_default(); if is_block_state_passable(block_state) { // block is already passable, no need to mine it @@ -191,7 +191,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_> { pub fn get_block_state(&self, block: BlockPos) -> BlockState { self.instance .read() - .get_block_state(&block) + .get_block_state(block) .unwrap_or_default() } } diff --git a/azalea/src/pathfinder/world.rs b/azalea/src/pathfinder/world.rs index 3ec95136..e9337503 100644 --- a/azalea/src/pathfinder/world.rs +++ b/azalea/src/pathfinder/world.rs @@ -625,13 +625,13 @@ mod tests { .chunks .set(&ChunkPos { x: 0, z: 0 }, Some(Chunk::default()), &mut world); partial_world.chunks.set_block_state( - &BlockPos::new(0, 0, 0), + BlockPos::new(0, 0, 0), azalea_registry::Block::Stone.into(), &world, ); partial_world .chunks - .set_block_state(&BlockPos::new(0, 1, 0), BlockState::AIR, &world); + .set_block_state(BlockPos::new(0, 1, 0), BlockState::AIR, &world); let ctx = CachedWorld::new(Arc::new(RwLock::new(world.into())), BlockPos::default()); assert!(!ctx.is_block_pos_passable(BlockPos::new(0, 0, 0))); @@ -646,13 +646,13 @@ mod tests { .chunks .set(&ChunkPos { x: 0, z: 0 }, Some(Chunk::default()), &mut world); partial_world.chunks.set_block_state( - &BlockPos::new(0, 0, 0), + BlockPos::new(0, 0, 0), azalea_registry::Block::Stone.into(), &world, ); partial_world .chunks - .set_block_state(&BlockPos::new(0, 1, 0), BlockState::AIR, &world); + .set_block_state(BlockPos::new(0, 1, 0), BlockState::AIR, &world); let ctx = CachedWorld::new(Arc::new(RwLock::new(world.into())), BlockPos::default()); assert!(ctx.is_block_pos_solid(BlockPos::new(0, 0, 0))); @@ -667,19 +667,19 @@ mod tests { .chunks .set(&ChunkPos { x: 0, z: 0 }, Some(Chunk::default()), &mut world); partial_world.chunks.set_block_state( - &BlockPos::new(0, 0, 0), + BlockPos::new(0, 0, 0), azalea_registry::Block::Stone.into(), &world, ); partial_world .chunks - .set_block_state(&BlockPos::new(0, 1, 0), BlockState::AIR, &world); + .set_block_state(BlockPos::new(0, 1, 0), BlockState::AIR, &world); partial_world .chunks - .set_block_state(&BlockPos::new(0, 2, 0), BlockState::AIR, &world); + .set_block_state(BlockPos::new(0, 2, 0), BlockState::AIR, &world); partial_world .chunks - .set_block_state(&BlockPos::new(0, 3, 0), BlockState::AIR, &world); + .set_block_state(BlockPos::new(0, 3, 0), BlockState::AIR, &world); let ctx = CachedWorld::new(Arc::new(RwLock::new(world.into())), BlockPos::default()); assert!(ctx.is_standable_at_block_pos(BlockPos::new(0, 1, 0))); |
