Cache after sleep near labeled chests

This commit is contained in:
Tanner
2026-11-08 17:08:12 +00:00
parent 930f4f3868
commit c79ee932a3
6 changed files with 166 additions and 10 deletions
+4 -8
View File
@@ -105,9 +105,10 @@ class GatherCropStates:
crop, section_size = self._select_crop(candidates, crop_types, p)
if crop is None:
print('No good crops left; retrying after a short wait.')
self.retry_after = time.monotonic() + 15.0
self.state = self.wait_for_crops
print('No good crops left; running maintenance after {} harvests'.format(
self.completed_crops))
self.completed_crops = 0
self.state = self.cleanup
return
print('Found crop:', crop,
@@ -116,10 +117,6 @@ class GatherCropStates:
self.type_id = w.block_at(*crop)
self.state = self.nav_to_crop
def wait_for_crops(self):
if time.monotonic() >= self.retry_after:
self.state = self.find_new_crop
def nav_to_crop(self):
w = self.g.world
p = utils.pint(self.g.pos)
@@ -251,7 +248,6 @@ class GatherCropStates:
self.seed_deadline = None
self.seed_wait_logged = False
self.active_section_anchor = None
self.retry_after = 0.0
self.bad_crops = []
self.completed_crops = 0