mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 02:56:17 -10:00
Keep the pilot fixture focused on an original content recipe
This commit is contained in:
1 parent
e76cb1f87a
commit
0e6e28109f
7 files changed
+12
-14
No files matched your search
+3
-2
@@ -66,12 +66,13 @@ Recipes mod and a matching `horizon-ctl`. This opt-in check fails if Recipes is
|
||||
LAN runs do not require it.
|
||||
|
||||
The runner installs the same original `tools/fixtures/recipes_hmod` package in both scratch game
|
||||
folders. It searches for its custom item, checks unknown recipes and missing ingredients, fills the
|
||||
folders. It finds the output of an original recipe (flint to two echo shards), checks unknown recipes
|
||||
and missing ingredients, fills the
|
||||
crafting grid through Recipes' `+` button, takes the result, and checks authoritative inventory counts
|
||||
before and after Save and Quit/rejoin. Logs, screenshots and `recipes-hmod.json` go under `--out`.
|
||||
As an assertion canary, changing only the fixture's result count from two to one must fail the custom
|
||||
result check; restore it before running the passing case. This is a content scenario, not general
|
||||
Java-mod compatibility coverage.
|
||||
Java-mod compatibility or custom-item registration coverage.
|
||||
|
||||
### The manifest
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"model":{"type":"minecraft:model","model":"minecraft:item/iron_nugget"}}
|
||||
@@ -1 +0,0 @@
|
||||
{"item.recipe_pilot.pressed_fragment":"Pilot Pressed Fragment"}
|
||||
@@ -1 +0,0 @@
|
||||
{"template":"minecraft:iron_nugget"}
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"minecraft:crafting_shapeless","ingredients":["minecraft:flint"],"result":{"id":"minecraft:echo_shard","count":2}}
|
||||
@@ -1 +0,0 @@
|
||||
{"type":"minecraft:crafting_shapeless","ingredients":["minecraft:flint"],"result":{"id":"recipe_pilot:pressed_fragment","count":2}}
|
||||
+8
-8
@@ -13123,8 +13123,8 @@ def check_recipes_hmod(host, guest, out):
|
||||
Opt in with --check recipes-hmod and --bin-dir pointing at a game compiled with the official
|
||||
native Recipes mod. The fixture is ours; no Java mod, copied assets or synthetic game replies.
|
||||
"""
|
||||
item = 'recipe_pilot:pressed_fragment'
|
||||
recipe = 'recipe_pilot:flint_to_fragment'
|
||||
item = 'minecraft:echo_shard'
|
||||
recipe = 'recipe_pilot:flint_to_echo_shard'
|
||||
seen = {}
|
||||
|
||||
def widget(game, predicate):
|
||||
@@ -13147,14 +13147,14 @@ def check_recipes_hmod(host, guest, out):
|
||||
game.wait(5)
|
||||
|
||||
def page(game):
|
||||
result = widget(game, lambda w: w.get('label') == 'Pilot Pressed Fragment'
|
||||
result = widget(game, lambda w: w.get('label') == 'Echo Shard'
|
||||
and w['kind'] == 'button')
|
||||
game.raw('click', result['id'])
|
||||
game.wait(5)
|
||||
return widget(game, lambda w: (w.get('label') or '').startswith('+ '))
|
||||
|
||||
def contents(game):
|
||||
return {'flint': server_count(game, 'flint'), 'fragment': server_count(game, item)}
|
||||
return {'flint': server_count(game, 'flint'), 'echo_shard': server_count(game, item)}
|
||||
|
||||
for game, supplied in ((host, 4), (guest, 5)):
|
||||
game('command', command='clear @s')
|
||||
@@ -13167,9 +13167,9 @@ def check_recipes_hmod(host, guest, out):
|
||||
game.raw('wait-for', 'screen', 'inventory', '--timeout', 10)
|
||||
assert game('screen').get('craft_size') == 3
|
||||
|
||||
# Search has a negative control as well as the custom namespace/name positive control.
|
||||
# The output exists in vanilla; its flint recipe is original .hmod content.
|
||||
search(game, 'recipe_pilot:no_such_item')
|
||||
assert not any(w.get('label') == 'Pilot Pressed Fragment' for w in game.raw('ui')['widgets'])
|
||||
assert not any(w.get('label') == 'Echo Shard' for w in game.raw('ui')['widgets'])
|
||||
search(game, item)
|
||||
game.shot(out, 'recipes-hmod-search')
|
||||
unknown = page(game)
|
||||
@@ -13188,7 +13188,7 @@ def check_recipes_hmod(host, guest, out):
|
||||
game.raw('click', known['id'])
|
||||
game.wait(10)
|
||||
missing = contents(game)
|
||||
assert missing == {'flint': 0, 'fragment': 0}, missing
|
||||
assert missing == {'flint': 0, 'echo_shard': 0}, missing
|
||||
assert not any(i for i, _ in grid_of(game, 100, 109).values())
|
||||
assert not result_of(game)[0], f'{game.name}: missing ingredients fabricated a result'
|
||||
game.shot(out, 'recipes-hmod-missing')
|
||||
@@ -13210,7 +13210,7 @@ def check_recipes_hmod(host, guest, out):
|
||||
assert not result_of(game)[0], f'{game.name}: consumed input left another result'
|
||||
back_to_game(game)
|
||||
crafted = contents(game)
|
||||
assert crafted == {'flint': supplied - 1, 'fragment': 2}, crafted
|
||||
assert crafted == {'flint': supplied - 1, 'echo_shard': 2}, crafted
|
||||
seen[game.name] = {'missing': missing, 'grid': grid, 'result': result, 'crafted': crafted}
|
||||
game('command', command=f'setblock {table[0]} {table[1]} {table[2]} minecraft:air')
|
||||
|
||||
|
||||
Reference in new issue
Block a user