Batch nether wart farming

This commit is contained in:
Tanner
2026-11-07 17:44:18 +00:00
parent a019b54396
commit 34d902c46d
2 changed files with 35 additions and 2 deletions
+10 -1
View File
@@ -9,6 +9,7 @@ from mosfet.info import items
class GatherWartStates:
WARTS_PER_BATCH = 16
BREAK_TIMEOUT = 5.0
ITEM_TIMEOUT = 8.0
PLACE_TIMEOUT = 3.0
@@ -118,8 +119,15 @@ class GatherWartStates:
def wait_place(self):
current = self.g.world.block_at(*self.wart)
if current in blocks.NETHERWART_IDS and current != self.type_id:
self.completed_warts += 1
print('Nether wart replanted at', self.wart)
self.state = self.cleanup
if self.completed_warts >= self.WARTS_PER_BATCH:
print('Completed {} nether wart harvests; running maintenance'.format(
self.completed_warts))
self.completed_warts = 0
self.state = self.cleanup
else:
self.state = self.find_new_wart
elif time.monotonic() > self.place_deadline:
print('Nether wart did not replant; blacklisting', self.wart)
self._blacklist_wart()
@@ -138,6 +146,7 @@ class GatherWartStates:
self.wart = None
self.type_id = None
self.bad_warts = []
self.completed_warts = 0
self.break_deadline = None
self.item_deadline = None
self.place_deadline = None