Aim crop farmers at targets with pitch limit

This commit is contained in:
Tanner
2026-11-07 17:35:32 +00:00
parent 95f4aa4821
commit a019b54396
6 changed files with 89 additions and 37 deletions
+17
View File
@@ -6,6 +6,23 @@ from mosfet.jobs.gather_crop import GatherCropStates
class CropBatchTests(unittest.TestCase):
def test_navigation_looks_at_the_crop_target(self):
crop = (5, 64, 8)
class FakeWorld:
@staticmethod
def path_to_place(_start, _target):
return [(1, 64, 1), crop]
g = Munch(world=FakeWorld(), pos=(1, 64, 1), path=[], look_at=None)
state = GatherCropStates(g)
state.crop = crop
state.nav_to_crop()
self.assertEqual(g.look_at, crop)
self.assertEqual(g.path[-1], crop)
def test_gather_crop_finishes_after_sixteen_successful_replants(self):
unripe_wheat = blocks.MCD_BLOCKS['wheat']['minStateId']
mature_wheat = blocks.MATURE_WHEAT_ID