Batch nether wart farming
This commit is contained in:
@@ -118,7 +118,8 @@ class GatherWartTests(unittest.TestCase):
|
||||
self.assertEqual(game.place_calls, [(support, 1)])
|
||||
world.state_id = unripe
|
||||
state.wait_place()
|
||||
self.assertIs(state.state.__func__, state.cleanup.__func__)
|
||||
self.assertEqual(state.completed_warts, 1)
|
||||
self.assertIs(state.state.__func__, state.find_new_wart.__func__)
|
||||
|
||||
def test_navigation_looks_at_the_wart_target(self):
|
||||
position = (5, 64, 8)
|
||||
@@ -137,6 +138,29 @@ class GatherWartTests(unittest.TestCase):
|
||||
self.assertEqual(g.look_at, position)
|
||||
self.assertEqual(g.path[-1], position)
|
||||
|
||||
def test_gather_wart_finishes_after_sixteen_successful_replants(self):
|
||||
mature = max(blocks.NETHERWART_IDS)
|
||||
unripe = min(blocks.NETHERWART_IDS)
|
||||
|
||||
class FakeWorld:
|
||||
@staticmethod
|
||||
def block_at(*_position):
|
||||
return unripe
|
||||
|
||||
state = GatherWartStates(Munch(world=FakeWorld()))
|
||||
state.wart = (5, 64, 8)
|
||||
state.type_id = mature
|
||||
|
||||
for completed in range(1, state.WARTS_PER_BATCH):
|
||||
state.wait_place()
|
||||
self.assertEqual(state.completed_warts, completed)
|
||||
self.assertIs(state.state.__func__, state.find_new_wart.__func__)
|
||||
state.state = state.wait_place
|
||||
|
||||
state.wait_place()
|
||||
self.assertEqual(state.completed_warts, 0)
|
||||
self.assertIs(state.state.__func__, state.cleanup.__func__)
|
||||
|
||||
def test_unreachable_wart_is_blacklisted_without_undefined_variable(self):
|
||||
position = (5, 64, 8)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user