Improve searching for crops
This commit is contained in:
@@ -35,8 +35,7 @@ class GatherCropStates:
|
||||
blocks.MATURE_BEETROOT_ID,
|
||||
]
|
||||
|
||||
for crop in w.find_blocks_3d(p, mature_crops, 50, 20):
|
||||
print('Found crop:', crop)
|
||||
for crop in w.find_blocks_3d(p, mature_crops, 50, 20, True):
|
||||
if crop not in self.bad_crops:
|
||||
break
|
||||
else: # for
|
||||
@@ -44,6 +43,7 @@ class GatherCropStates:
|
||||
self.state = self.cleanup
|
||||
return
|
||||
|
||||
print('Found crop:', crop)
|
||||
self.crop = crop
|
||||
self.type_id = w.block_at(*crop)
|
||||
self.state = self.nav_to_crop
|
||||
@@ -55,10 +55,12 @@ class GatherCropStates:
|
||||
navpath = w.path_to_place(p, self.crop)
|
||||
|
||||
if navpath:
|
||||
print('Going to crop', self.crop)
|
||||
self.g.path = navpath
|
||||
self.g.look_at = utils.padd(self.crop, path.BLOCK_BELOW)
|
||||
self.state = self.going_to_crop
|
||||
else:
|
||||
print('Cant get to it, blacklisting')
|
||||
self.bad_crops.append(self.crop)
|
||||
self.wait_time = 0.5
|
||||
self.state = self.wait_to_restart
|
||||
|
||||
Reference in New Issue
Block a user