From 338f931c51ab3665c7c18124ca3e35bfd2ff5ca0 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 5 Jun 2025 00:59:14 -0400 Subject: wait for block to exist when calling open_container_at --- azalea/src/pathfinder/goals.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'azalea/src/pathfinder') diff --git a/azalea/src/pathfinder/goals.rs b/azalea/src/pathfinder/goals.rs index aa6f357a..4c0dbafa 100644 --- a/azalea/src/pathfinder/goals.rs +++ b/azalea/src/pathfinder/goals.rs @@ -220,6 +220,12 @@ impl Goal for ReachBlockPosGoal { BlockPosGoal(self.pos).heuristic(n) } fn success(&self, n: BlockPos) -> bool { + if n.up(1) == self.pos { + // our head is in the block, assume it's always reachable (to reduce the amount + // of impossible goals) + return true; + } + // only do the expensive check if we're close enough let distance = self.pos.distance_squared_to(&n); if distance > self.max_check_distance.pow(2) { -- cgit v1.2.3