[PR #5447] [MERGED] Recipes parse NeoForge's standard ingredient shapes #6292

Closed
opened 2026-11-03 06:17:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5447
Author: @Qwerner88880
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: hooks-ingredients


📝 Commits (8)

  • 6174667 Recipes answer NeoForge's load conditions
  • 3379d00 Load conditions: mod IDs, not namespaces; unknown fails closed; the overlay replaces before the gate
  • bb0e421 Recipes parse NeoForge's standard ingredient shapes
  • 42e5a2f Load conditions: an unknown kind nested in the tree leaves the file out
  • 1841925 Ingredient shapes: compound is the union, intersection the all-of; ingredient_type key; fluid dropped
  • 88e4e2b Merge main into #5439
  • 1488ba1 Merge main and #5439's main merge into #5447
  • b7ce7c0 crafting test: a tag's items have no fixed order

📊 Changes

9 files changed (+490 additions, -12 deletions)

View changed files

📝 crates/horizon-client-render/src/brewing.rs (+15 -0)
📝 crates/horizon-client/src/crafting.rs (+235 -0)
📝 crates/horizon-client/src/mod_content.rs (+5 -0)
📝 crates/horizon-client/src/recipe_book.rs (+34 -12)
📝 crates/horizon-client/src/stations.rs (+15 -0)
📝 crates/horizon-items/src/content_namespaces.rs (+14 -0)
➕ crates/horizon-world/src/conditions.rs (+161 -0)
📝 crates/horizon-world/src/lib.rs (+1 -0)
📝 docs/native-mods.md (+10 -0)

📄 Description

🤖 Opened by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally.

What and why

Fixes the ingredient half of #5367. Part of #4953 ("More content registration") and #3911 (Mods). Stacked on #5439 — review only the last commit (6cc44a69f).

A mod's recipe whose ingredient is one of NeoForge's standard object shapes dropped out of the loader whole — Ingredient::parse took a string, a tag or a list and nothing else, so the machine the recipe belonged to was dead on arrival. Vanilla 26.3 itself has no object ingredients (checked in the jar: Ingredient's codec is still the flat holder-set), so these shapes are NeoForge's, and this resolves the ones mods actually ship:

  • neoforge:compound / neoforge:intersection — the items every sub-ingredient names, in the first's order (the all-of matcher, statically).
  • neoforge:difference — the base's items without the subtracted's.

A kind outside these still fails the file, as today: a mod's own ingredient types (predicates over components and the like) can't flatten to an item list, and come with their own hook in a follow-up under the same claim — not hidden inside the loader.

Kind

  • parity: Horizon now does what NeoForge does
  • bug: a crash or a breakage
  • feature: something new for players
  • tooling
  • docs

Vanilla reference

NeoForge's ingredient types (NeoForgeRegistries.Keys.INGREDIENT_TYPES, public docs); vanilla 26.3's own Ingredient has no object shapes (jar-checked), so nothing vanilla moves.

Other projects' code

none

Tests

Unit: every shape parses to its list (a tag beside an item intersects to one; difference removes), an empty intersection and an unknown kind fail the file. Integration: a temp root's mymod:treated shapeless recipe with a compound and a difference ingredient loads into the crafting list — the file the plain parser dropped. Not run live in a game: this is the parse layer, below any hook, and the observable (the loaded crafting list) is what the integration test asserts; #5439's live run covers the loaders around it.

Self-check

Check Result
Scope ✅ 7 files, +376 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 505 passed (56 s)
rustfmt ✅ (8 s)
clippy ✅ (17 s)
tests: horizon-client, horizon-client-render, horizon-world ❌ 1048 passed, 1 failed (38 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The one red, title_screen_keyboard_navigation_and_activation, is main's own (#5436) and fails identically on pristine main.

🤖 Generated with ZCode (GLM-5.3)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5447 **Author:** [@Qwerner88880](https://github.com/Qwerner88880) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hooks-ingredients` --- ### 📝 Commits (8) - [`6174667`](https://github.com/horizon-rust/horizon/commit/617466720ae31e8947bf3ebb987b2326015dd798) Recipes answer NeoForge's load conditions - [`3379d00`](https://github.com/horizon-rust/horizon/commit/3379d00ae0dac0695a56d8d7798070b7f8a937dd) Load conditions: mod IDs, not namespaces; unknown fails closed; the overlay replaces before the gate - [`bb0e421`](https://github.com/horizon-rust/horizon/commit/bb0e4216743b0144ee2d1e7f8cedfc5675c75ea9) Recipes parse NeoForge's standard ingredient shapes - [`42e5a2f`](https://github.com/horizon-rust/horizon/commit/42e5a2fb8e9b64bf5fbb1034e592456d71f8c260) Load conditions: an unknown kind nested in the tree leaves the file out - [`1841925`](https://github.com/horizon-rust/horizon/commit/1841925457b547e999f3315055158b92acb860ff) Ingredient shapes: compound is the union, intersection the all-of; ingredient_type key; fluid dropped - [`88e4e2b`](https://github.com/horizon-rust/horizon/commit/88e4e2b8475634ed95ee988e622c01cd6fb1d7a3) Merge main into #5439 - [`1488ba1`](https://github.com/horizon-rust/horizon/commit/1488ba172e097d08b8a4cd4093e9b8bdbdd97578) Merge main and #5439's main merge into #5447 - [`b7ce7c0`](https://github.com/horizon-rust/horizon/commit/b7ce7c00da34a151dcdb5b209e495adda8f24cb5) crafting test: a tag's items have no fixed order ### 📊 Changes **9 files changed** (+490 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/brewing.rs` (+15 -0) 📝 `crates/horizon-client/src/crafting.rs` (+235 -0) 📝 `crates/horizon-client/src/mod_content.rs` (+5 -0) 📝 `crates/horizon-client/src/recipe_book.rs` (+34 -12) 📝 `crates/horizon-client/src/stations.rs` (+15 -0) 📝 `crates/horizon-items/src/content_namespaces.rs` (+14 -0) ➕ `crates/horizon-world/src/conditions.rs` (+161 -0) 📝 `crates/horizon-world/src/lib.rs` (+1 -0) 📝 `docs/native-mods.md` (+10 -0) </details> ### 📄 Description > 🤖 Opened by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally. ## What and why Fixes the ingredient half of #5367. Part of #4953 ("More content registration") and #3911 (Mods). **Stacked on #5439 — review only the last commit** (`6cc44a69f`). A mod's recipe whose ingredient is one of NeoForge's standard object shapes dropped out of the loader whole — `Ingredient::parse` took a string, a tag or a list and nothing else, so the machine the recipe belonged to was dead on arrival. Vanilla 26.3 itself has no object ingredients (checked in the jar: `Ingredient`'s codec is still the flat holder-set), so these shapes are NeoForge's, and this resolves the ones mods actually ship: - **`neoforge:compound` / `neoforge:intersection`** — the items every sub-ingredient names, in the first's order (the all-of matcher, statically). - **`neoforge:difference`** — the base's items without the subtracted's. A kind outside these still fails the file, as today: a mod's **own** ingredient types (predicates over components and the like) can't flatten to an item list, and come with their own hook in a follow-up under the same claim — not hidden inside the loader. ## Kind - [x] parity: Horizon now does what NeoForge does - [ ] bug: a crash or a breakage - [ ] feature: something new for players - [ ] tooling - [ ] docs ## Vanilla reference NeoForge's ingredient types (`NeoForgeRegistries.Keys.INGREDIENT_TYPES`, public docs); vanilla 26.3's own `Ingredient` has no object shapes (jar-checked), so nothing vanilla moves. ## Other projects' code none ## Tests **Unit:** every shape parses to its list (a tag beside an item intersects to one; difference removes), an empty intersection and an unknown kind fail the file. **Integration:** a temp root's `mymod:treated` shapeless recipe with a compound and a difference ingredient loads into the crafting list — the file the plain parser dropped. Not run live in a game: this is the parse layer, below any hook, and the observable (the loaded crafting list) is what the integration test asserts; #5439's live run covers the loaders around it. ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 7 files, +376 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 505 passed (56 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (17 s) | | tests: horizon-client, horizon-client-render, horizon-world | ❌ 1048 passed, 1 failed (38 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The one red, `title_screen_keyboard_navigation_and_activation`, is main's own (#5436) and fails identically on pristine main. 🤖 Generated with ZCode (GLM-5.3) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:17:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6292
No description provided.