Re-enable wood farming, add sapling label

This commit is contained in:
Tanner committed 2026-11-14 22:23:41 +00:00
1 parent afd4c524c2
commit 11c1bad0c4
3 files changed
+14 -6

No files matched your search

+7 -6
View File
@@ -65,6 +65,7 @@ class Commands:
if data.startswith('[') and data.endswith(']'): if data.startswith('[') and data.endswith(']'):
command = 'nosquarebrackets' command = 'nosquarebrackets'
farm_target = data.casefold().strip()
unsupported = { unsupported = {
'trade', 'gapple', 'fill', 'trade', 'gapple', 'fill',
'break', 'open', 'click', 'use', 'interact', 'break', 'open', 'click', 'use', 'interact',
@@ -72,8 +73,8 @@ class Commands:
if ((command == 'gather' and data.lower().strip() != 'wood') or if ((command == 'gather' and data.lower().strip() != 'wood') or
command in unsupported or command in unsupported or
(command == 'farm' and (command == 'farm' and
not data.lower().startswith('crop') and not farm_target.startswith('crop') and
data.lower().strip() not in ('wood', 'wart'))): farm_target not in ('wood', 'logs', 'wart'))):
reply = 'not migrated to Minecraft 26.3 yet' reply = 'not migrated to Minecraft 26.3 yet'
print('Reply:', reply) print('Reply:', reply)
self._send_reply(reply, private, reply_target) self._send_reply(reply, private, reply_target)
@@ -475,12 +476,12 @@ class Commands:
else: else:
reply += ', I need a bed' reply += ', I need a bed'
## 1farm wood - farms wood from a certain area ## 1farm logs (or wood) - farms trees and caches their logs
## 1farm sand - farms sand from a certain area ## 1farm sand - farms sand from a certain area
## 1farm wart - farms netherwart from a certain area ## 1farm wart - farms netherwart from a certain area
## 1farm crop - farms mature crops from a certain area ## 1farm crop - farms mature crops from a certain area
if command == 'farm' and data: if command == 'farm' and data:
if data == 'wood': if farm_target in ('wood', 'logs'):
self.g.job.state = self.g.job.farm_wood self.g.job.state = self.g.job.farm_wood
reply = 'ok' reply = 'ok'
elif data == 'sand': elif data == 'sand':
@@ -488,10 +489,10 @@ class Commands:
self.g.sand_origin = utils.pint(self.g.pos) self.g.sand_origin = utils.pint(self.g.pos)
self.g.job.state = self.g.job.farm_sand self.g.job.state = self.g.job.farm_sand
reply = 'ok' reply = 'ok'
elif data == 'wart': elif farm_target == 'wart':
self.g.job.state = self.g.job.farm_wart self.g.job.state = self.g.job.farm_wart
reply = 'ok' reply = 'ok'
elif data.startswith('crop'): elif farm_target.startswith('crop'):
mode = self.g.get('game_mode') mode = self.g.get('game_mode')
if mode is not None and mode != 0: if mode is not None and mode != 0:
reply = 'crop farming needs Survival mode' reply = 'crop farming needs Survival mode'
+1
View File
@@ -91,6 +91,7 @@ _LABEL_ITEM_IDS = {
}), }),
'wheat': {WHEAT_ID}, 'wheat': {WHEAT_ID},
'log': LOG_IDS, 'log': LOG_IDS,
'sapling': SAPLING_IDS,
} }
+6
View File
@@ -10,6 +10,7 @@ class StorageLabelTests(unittest.TestCase):
seeds = items.storage_item_ids_for_label('Seeds') seeds = items.storage_item_ids_for_label('Seeds')
wheat = items.storage_item_ids_for_label('Wheat') wheat = items.storage_item_ids_for_label('Wheat')
logs = items.storage_item_ids_for_label('Logs') logs = items.storage_item_ids_for_label('Logs')
saplings = items.storage_item_ids_for_label('Saplings')
self.assertEqual(seeds, items.get_set({ self.assertEqual(seeds, items.get_set({
'beetroot_seeds', 'melon_seeds', 'pitcher_pod', 'pumpkin_seeds', 'beetroot_seeds', 'melon_seeds', 'pitcher_pod', 'pumpkin_seeds',
@@ -30,6 +31,11 @@ class StorageLabelTests(unittest.TestCase):
'stripped_warped_hyphae', 'mushroom_stem', 'stripped_warped_hyphae', 'mushroom_stem',
}) <= logs) }) <= logs)
self.assertNotIn(items.WHEAT_ID, logs) self.assertNotIn(items.WHEAT_ID, logs)
self.assertEqual(saplings, items.SAPLING_IDS)
self.assertTrue(items.get_set({
'oak_sapling', 'pale_oak_sapling', 'mangrove_propagule',
}) <= saplings)
self.assertFalse(saplings & items.LOG_IDS)
def test_sign_label_associates_with_adjacent_double_chest(self): def test_sign_label_associates_with_adjacent_double_chest(self):
sign_pos = (0, 64, 0) sign_pos = (0, 64, 0)