[GH-ISSUE #6400] Native mods: a file-declared item can't use a code-declared item as its crafting remainder #2079

Closed
opened 2026-11-02 15:51:52 +07:00 by bsakaguchi · 3 comments
Owner

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

🤖 Filed by Aria's agent swarm, Dyna, not by Aria.

A file-declared item can't name a code-declared item as its crafting remainder

This came up while testing #6359 (blocks and items declared in code, native_blocks / native_items) in game; it merged before our review was posted. It's still on main at 7ee14b2df6.

Code:

  • In crates/horizon-client/src/game/mods.rs, each content mod's files are read and checked by Content::read (mods.rs:88) before the native mods' declarations are collected (mods.rs:114) and merged in through accept_declared (mods.rs:123).
  • The remainder check in Content::read (crates/horizon-mods/src/content.rs:695-705) only knows the items in that mod's own files.
  • So when a file-declared item has crafting_remainder set to an item the same mod declares in code, the check fails.
  • The whole content mod is refused, including its other blocks, items, assets and lang.

In game: at bed9c5fd86, with a throwaway horizon-machine-sample branch, which is the recommended test route. The sample declares machine_sample:wrench in code, plus a file-declared item with "crafting_remainder": "machine_sample:wrench". On the server thread:

  • the log says the wrench is not one of the mod's items;
  • /give @s machine_sample:tool says the item is unknown;
  • the code-declared wrench still exists, but its name and the pipe's name show as raw translation keys, because the content mod was refused.

Without that file, the code-declared pipe and wrench loaded normally. On a local dedicated server, a joined client saw the pipe's model and its powered=true state, the state survived a restart, and mining the pipe dropped a pipe item.

Possible direction: check remainders once the code declarations are known, or let the check accept ids that native_items declares for the same mod. The check for items declared in code already knows the file-declared ones (content.rs:481-493), so only this direction fails.

Originally created by @arismoko on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6400 > 🤖 Filed by Aria's agent swarm, Dyna, not by Aria. **A file-declared item can't name a code-declared item as its crafting remainder** This came up while testing #6359 (blocks and items declared in code, `native_blocks` / `native_items`) in game; it merged before our review was posted. It's still on main at `7ee14b2df6`. **Code:** - In `crates/horizon-client/src/game/mods.rs`, each content mod's files are read and checked by `Content::read` (`mods.rs:88`) before the native mods' declarations are collected (`mods.rs:114`) and merged in through `accept_declared` (`mods.rs:123`). - The remainder check in `Content::read` (`crates/horizon-mods/src/content.rs:695-705`) only knows the items in that mod's own files. - So when a file-declared item has `crafting_remainder` set to an item the same mod declares in code, the check fails. - The whole content mod is refused, including its other blocks, items, assets and lang. **In game:** at `bed9c5fd86`, with a throwaway [horizon-machine-sample](https://github.com/arismoko/horizon-machine-sample) branch, which is the recommended test route. The sample declares `machine_sample:wrench` in code, plus a file-declared item with `"crafting_remainder": "machine_sample:wrench"`. On the server thread: - the log says the wrench is not one of the mod's items; - `/give @s machine_sample:tool` says the item is unknown; - the code-declared wrench still exists, but its name and the pipe's name show as raw translation keys, because the content mod was refused. Without that file, the code-declared pipe and wrench loaded normally. On a local dedicated server, a joined client saw the pipe's model and its `powered=true` state, the state survived a restart, and mining the pipe dropped a pipe item. **Possible direction:** check remainders once the code declarations are known, or let the check accept ids that `native_items` declares for the same mod. The check for items declared in code already knows the file-declared ones (`content.rs:481-493`), so only this direction fails.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6563716888 --> @breachato commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2026):

🤖 Claims: refused, You hold 8 open issues: finish or /unclaim one first. (asked by @breachato)

<!-- gh-comment-id:6563718712 --> @github-actions[bot] commented on GitHub (Nov 1, 2026): 🤖 Claims: refused, You hold 8 open issues: finish or `/unclaim` one first. (asked by @breachato)
Author
Owner

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

🤖 Agent: a fix is open in 6442; it closes this issue when merged.

<!-- gh-comment-id:6563786027 --> @xFedeT commented on GitHub (Nov 1, 2026): 🤖 Agent: a fix is open in 6442; it closes this issue when merged.
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#2079
No description provided.