[GH-ISSUE #6368] Recipe book sync sends empty ingredients for NeoForge's object shapes #2066

Closed
opened 2026-11-02 15:51:45 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Qwerner88880 on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6368

Originally assigned to: @Qwerner88880 on GitHub.

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

Part of #4953. Found while reviewing the ingredient-kind hook for #5367, but the bug is already on main: it affects every recipe that uses one of NeoForge's standard ingredient shapes (#5447 merged them).

holder_set (crates/horizon-client/src/lan/advancements.rs:543) writes the recipe book's ingredient to connected clients. A string, a tag and an array encode correctly; any other JSON value — including every object shape: neoforge:compound, neoforge:intersection, neoforge:difference, and a mod's own kind — falls to _ => w.varint(1), which is an empty list.

The network copy of the recipes is loaded separately from the crafting copy (ServerAdvancements::load, advancements.rs:42), so the flat lists the loader resolves never reach it.

Effect: a connected client sees the recipe with an empty ingredient slot in the recipe book; a vanilla client, if it rejects empty ingredients, may disconnect. The shapes were verified to parse and craft correctly on the server in #5447 — only the sync path is broken.

What the fix covers:

  • key (the shaped recipe's symbol map — the main missed path), ingredients, ingredient, base, addition, template
  • both sync paths: ServerAdvancements::load and lan/recipes.rs's stonecutting/smithing (update_recipes, PROPERTY_SETS)
  • only known vanilla recipe types (a mod's own types keep their JSON whole)
  • unknown items (a resolved list entry the item registry doesn't know) are dropped from the sync, not sent as id 0
  • recipes whose ingredients don't resolve at all are removed from the sync copy, matching what the server actually loaded
Originally created by @Qwerner88880 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6368 Originally assigned to: @Qwerner88880 on GitHub. > 🤖 Filed by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally. Part of #4953. Found while reviewing the ingredient-kind hook for #5367, but the bug is already on main: it affects every recipe that uses one of NeoForge's standard ingredient shapes (#5447 merged them). `holder_set` (`crates/horizon-client/src/lan/advancements.rs:543`) writes the recipe book's ingredient to connected clients. A string, a tag and an array encode correctly; any other JSON value — including every object shape: `neoforge:compound`, `neoforge:intersection`, `neoforge:difference`, and a mod's own kind — falls to `_ => w.varint(1)`, which is an empty list. The network copy of the recipes is loaded separately from the crafting copy (`ServerAdvancements::load`, `advancements.rs:42`), so the flat lists the loader resolves never reach it. **Effect:** a connected client sees the recipe with an empty ingredient slot in the recipe book; a vanilla client, if it rejects empty ingredients, may disconnect. The shapes were verified to parse and craft correctly on the server in #5447 — only the sync path is broken. **What the fix covers:** - `key` (the shaped recipe's symbol map — the main missed path), `ingredients`, `ingredient`, `base`, `addition`, `template` - both sync paths: `ServerAdvancements::load` and `lan/recipes.rs`'s stonecutting/smithing (`update_recipes`, `PROPERTY_SETS`) - only known vanilla recipe types (a mod's own types keep their JSON whole) - unknown items (a resolved list entry the item registry doesn't know) are dropped from the sync, not sent as id 0 - recipes whose ingredients don't resolve at all are removed from the sync copy, matching what the server actually loaded
Author
Owner

@Qwerner88880 commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6563028792 --> @Qwerner88880 commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
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#2066
No description provided.