Allow bot names 1-9 instead of 1-3

This commit is contained in:
Tanner committed 2026-11-19 17:23:42 +00:00
1 parent fb28fefc8a
commit 1dd02f887c
9 files changed
+75 -48

No files matched your search

+34 -2
View File
@@ -93,10 +93,11 @@ class SignReadingTests(unittest.TestCase):
'mosfet', 'stay within25', 'square', '',
]}}},
}), pos=(0, 64, 0)))
for bot_name in ('mosfet1', 'mosfet2', 'mosfet3'):
for bot_num in range(1, 10):
bot_name = 'mosfet{}'.format(bot_num)
self.assertEqual([p['shape'] for p in
group_world.sign_policies(bot_name)], ['square'])
self.assertEqual(group_world.sign_policies('mosfet4'), [])
self.assertEqual(group_world.sign_policies('mosfet10'), [])
individual_world = World(Munch(chunks=Munch(block_entities={
(1, 64, 0): {'data': {'front_text': {'messages': [
@@ -131,6 +132,37 @@ class SignReadingTests(unittest.TestCase):
world.find_sand_origins((0, 64, 0), 'mosfet2')],
[(1, 64, 0), (2, 64, 0)],
)
self.assertEqual(
[origin['position'] for origin in
world.find_sand_origins((0, 64, 0), 'mosfet9')],
[(1, 64, 0)],
)
self.assertEqual(
world.find_sand_origins((0, 64, 0), 'mosfet10'), [])
def test_supply_sign_group_address_includes_bot_nine_only(self):
sign_pos = (0, 64, 0)
chest_pos = (1, 64, 0)
sign_state = blocks.MCD_BLOCKS['oak_wall_sign']['minStateId']
chest_state = next(
state for state in blocks.CHEST_IDS
if blocks.PROPS[state].get('type') == 'single')
block_states = {sign_pos: sign_state, chest_pos: chest_state}
chunks = Munch(
block_entities={sign_pos: {'data': {'front_text': {
'messages': ['mosfet supplies', '', '', ''],
}}}},
index={},
get_block_at=lambda *pos: block_states.get(tuple(pos), blocks.AIR),
)
world = World(Munch(chunks=chunks))
supplies = world.find_supply_chests(sign_pos, 'mosfet9', 10)
self.assertEqual(len(supplies), 1)
self.assertEqual(supplies[0]['positions'], (chest_pos,))
self.assertEqual(world.find_supply_chests(
sign_pos, 'mosfet10', 10), [])
def test_sign_policies_read_any_distance_within_loaded_signs(self):
position = (100, 64, 0)