Avoid planted saplings when pathfinding

This commit is contained in:
Tanner committed 2026-11-19 14:42:07 +00:00
1 parent 0a499f901a
commit 0b462f4a76
2 files changed
+18 -7

No files matched your search

+11
View File
@@ -27,6 +27,17 @@ class DoorNavigationTests(unittest.TestCase):
blocks.PROPS[state].get('open') == str(opened).lower() and
blocks.PROPS[state].get('powered') == str(powered).lower())
def test_pathfinder_avoids_all_sapling_and_propagule_states(self):
self.assertTrue(blocks.SAPLING_IDS)
self.assertLessEqual(blocks.SAPLING_IDS, blocks.AVOID_IDS)
state_id = next(iter(blocks.SAPLING_IDS))
finder = Pathfinder(Munch(
chunks=FakeChunks({(1, 64, 0): state_id}),
crawling=False, unopenable_doors=set()))
self.assertTrue(finder.bavoid((1, 64, 0)))
self.assertFalse(finder.check_traverse((0, 64, 0), (1, 0, 0)))
def test_pathfinder_treats_openable_doors_as_passable_but_not_iron(self):
wooden = self.door_state('oak_door')
iron = self.door_state('iron_door')