[PR #4925] [MERGED] feat(mods): content items declare a crafting remainder #5946

Closed
opened 2026-11-03 05:16:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4925
Author: @reservedbytes
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: feat/content-crafting-remainder


📝 Commits (2)

  • 7dd10ac feat(mods): content items declare a crafting remainder
  • cffc83b Merge hr/main into feat/content-crafting-remainder

📊 Changes

6 files changed (+189 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/mod_content.rs (+27 -0)
📝 crates/horizon-client/src/mod_content_tests.rs (+42 -2)
📝 crates/horizon-items/src/items.rs (+44 -1)
📝 crates/horizon-mods/src/content.rs (+62 -0)
📝 docs/modpacks.md (+2 -2)
📝 docs/mods.md (+12 -0)

📄 Description

What and why

A content mod's item can't leave anything in the crafting grid, so a mod's stew used in a recipe takes the bowl with it
Vanilla has this as Item.Properties.craftRemainder (a milk bucket leaves a bucket), which isn't a data component, so #3739's components can't set it

An item file now takes crafting_remainder, a vanilla item or one of the mod's own

{ "template": "minecraft:mushroom_stew", "crafting_remainder": "minecraft:bowl" }

Anything else is refused at load, and a misspelt id like minecraft:bowll fails the content root build
The remainders go in their own file in the content root, read by Items::load after vanilla's table, so nothing changes without a mod that uses the key
It holds on the crafting table, the inventory grid and the crafter, they all read the same item field

Checked with prepared 26.3 data too: the content root test crafts the mod's stew and gets a bowl back

Known limits
A copy of minecraft:milk_bucket doesn't inherit its bucket, the mod has to set the key (vanilla's table is by item id, I kept it that way)
Furnace fuel and brewing aren't wired... I think vanilla uses the craft remainder there too, but Horizon's furnace has the buckets hardcoded and brewing reads use_remainder, so I left both for a next PR

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Item.Properties.craftRemainder, read by Recipe.getRemainingItems and CraftingRecipe.defaultCraftingReminder

Self-check

Check Result
Scope ✅ 6 files, +189 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 484 passed (57 s)
rustfmt ✅ (10 s)
clippy ✅ (2 min 23 s)
tests: horizon-client, horizon-items, horizon-mods ✅ 1344 passed (5 min 33 s)
doc tests ✅ 0 passed (1 s)
content root tests ✅ 6 passed (1 min 0 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (1 min 9 s)
launcher tests ✅ 300 passed (2 min 39 s)
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)

🔄 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/4925 **Author:** [@reservedbytes](https://github.com/reservedbytes) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `feat/content-crafting-remainder` --- ### 📝 Commits (2) - [`7dd10ac`](https://github.com/horizon-rust/horizon/commit/7dd10acb863e161ba86ea740ce375f51fa6462f0) feat(mods): content items declare a crafting remainder - [`cffc83b`](https://github.com/horizon-rust/horizon/commit/cffc83bb8b6c520c78d85e904c884fec61fbf4cd) Merge hr/main into feat/content-crafting-remainder ### 📊 Changes **6 files changed** (+189 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mod_content.rs` (+27 -0) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+42 -2) 📝 `crates/horizon-items/src/items.rs` (+44 -1) 📝 `crates/horizon-mods/src/content.rs` (+62 -0) 📝 `docs/modpacks.md` (+2 -2) 📝 `docs/mods.md` (+12 -0) </details> ### 📄 Description ## What and why A content mod's item can't leave anything in the crafting grid, so a mod's stew used in a recipe takes the bowl with it Vanilla has this as `Item.Properties.craftRemainder` (a milk bucket leaves a bucket), which isn't a data component, so #3739's `components` can't set it An item file now takes `crafting_remainder`, a vanilla item or one of the mod's own ```json { "template": "minecraft:mushroom_stew", "crafting_remainder": "minecraft:bowl" } ``` Anything else is refused at load, and a misspelt id like `minecraft:bowll` fails the content root build The remainders go in their own file in the content root, read by `Items::load` after vanilla's table, so nothing changes without a mod that uses the key It holds on the crafting table, the inventory grid and the crafter, they all read the same item field Checked with prepared 26.3 data too: the content root test crafts the mod's stew and gets a bowl back Known limits A copy of `minecraft:milk_bucket` doesn't inherit its bucket, the mod has to set the key (vanilla's table is by item id, I kept it that way) Furnace fuel and brewing aren't wired... I think vanilla uses the craft remainder there too, but Horizon's furnace has the buckets hardcoded and brewing reads `use_remainder`, so I left both for a next PR ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `Item.Properties.craftRemainder`, read by `Recipe.getRemainingItems` and `CraftingRecipe.defaultCraftingReminder` ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 6 files, +189 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 484 passed (57 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (2 min 23 s) | | tests: horizon-client, horizon-items, horizon-mods | ✅ 1344 passed (5 min 33 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ✅ 6 passed (1 min 0 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (1 min 9 s) | | launcher tests | ✅ 300 passed (2 min 39 s) | | 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) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:07 +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#5946
No description provided.