Apply sign work zones before candidate routing

This commit is contained in:
Tanner
2026-11-06 01:10:31 +00:00
parent a60d913c60
commit ab8f59a89b
11 changed files with 309 additions and 12 deletions
+7 -3
View File
@@ -30,10 +30,11 @@ class GatherWoodStates:
w = self.g.world
p = utils.pint(self.g.pos)
for tree in w.find_trees(p, 100):
print('Found tree:', tree)
trees = w.filter_work_positions(w.find_trees(p, 100))
for tree in trees:
if tree in self.bad_trees:
continue
print('Found tree:', tree)
tree_type = blocks.BLOCKS[w.block_at(*tree)].replace('_log', '')
if items.get_sapling_id(tree_type) is None:
print('No plantable sapling for', tree_type, '- skipping')
@@ -53,7 +54,10 @@ class GatherWoodStates:
def find_openings(self):
w = self.g.world
self.openings = w.find_tree_openings(self.tree)
self.openings = [
opening for opening in w.find_tree_openings(self.tree)
if w.work_position_allowed(opening)
]
self.state = self.choose_opening
def choose_opening(self):