[PR #4921] [MERGED] feat(mods): block items patch their template item's data components #5941

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

📋 Pull Request Information

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

Base: main ← Head: feat/content-block-item-components


📝 Commits (4)

  • 2a8ae89 feat(mods): block items patch their template item's data components
  • 37fd665 Merge remote-tracking branch 'hr/main' into fix/pr-4921
  • ff5db37 Check block component values for max_stack_size and rarity
  • 0d1e3df Merge remote-tracking branch 'hr/main' into fix/pr-4921

📊 Changes

5 files changed (+190 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/mod_content.rs (+14 -7)
📝 crates/horizon-client/src/mod_content_tests.rs (+72 -2)
📝 crates/horizon-mods/src/content.rs (+91 -4)
📝 docs/modpacks.md (+1 -1)
📝 docs/mods.md (+12 -0)

📄 Description

What and why

Since #3739 a content mod's item can patch its template's data components, but a block's item can't
So a modded block item is stuck with its template block's item: same stack size, rarity, fire resistance

A block file now takes the same components, over its template block's item

{ "template": "minecraft:iron_block",
  "components": {
    "minecraft:max_stack_size": 16,
    "minecraft:damage_resistant": { "types": "#minecraft:is_fire" } } }

It uses #3739's checks and conversion (now shared), so the same things are refused, plus components on a block with "item": false
max_stack_size and rarity are fine in the patch here, block files have no keys of their own for them
Nothing changes for a mod without components

Checked with prepared 26.3 data too: the content root test gets the ruby block's item at 16 a stack and fire resistant, iron block still 64

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

DataComponentPatch's codec, as in #3739

Self-check

Check Result
Scope ✅ 5 files, +157 −15
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 484 passed (1 min 1 s)
rustfmt ✅ (7 s)
clippy ✅ (2 min 12 s)
tests: horizon-client, horizon-mods ✅ 1308 passed (4 min 57 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 10 s)
launcher tests ✅ 300 passed (2 min 11 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/4921 **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-block-item-components` --- ### 📝 Commits (4) - [`2a8ae89`](https://github.com/horizon-rust/horizon/commit/2a8ae891ae96f48fa7bf8c9c2b2af50ef33a396c) feat(mods): block items patch their template item's data components - [`37fd665`](https://github.com/horizon-rust/horizon/commit/37fd66562f6f5b4694a3cf19ebd2d102b47e9270) Merge remote-tracking branch 'hr/main' into fix/pr-4921 - [`ff5db37`](https://github.com/horizon-rust/horizon/commit/ff5db37b0e77a394e0f22c264b41650af86812d8) Check block component values for max_stack_size and rarity - [`0d1e3df`](https://github.com/horizon-rust/horizon/commit/0d1e3dfd412bd8be9433ce2741776a55a97089af) Merge remote-tracking branch 'hr/main' into fix/pr-4921 ### 📊 Changes **5 files changed** (+190 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mod_content.rs` (+14 -7) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+72 -2) 📝 `crates/horizon-mods/src/content.rs` (+91 -4) 📝 `docs/modpacks.md` (+1 -1) 📝 `docs/mods.md` (+12 -0) </details> ### 📄 Description ## What and why Since #3739 a content mod's item can patch its template's data components, but a block's item can't So a modded block item is stuck with its template block's item: same stack size, rarity, fire resistance A block file now takes the same `components`, over its template block's item ```json { "template": "minecraft:iron_block", "components": { "minecraft:max_stack_size": 16, "minecraft:damage_resistant": { "types": "#minecraft:is_fire" } } } ``` It uses #3739's checks and conversion (now shared), so the same things are refused, plus `components` on a block with `"item": false` `max_stack_size` and `rarity` are fine in the patch here, block files have no keys of their own for them Nothing changes for a mod without `components` Checked with prepared 26.3 data too: the content root test gets the ruby block's item at 16 a stack and fire resistant, iron block still 64 ## 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 `DataComponentPatch`'s codec, as in #3739 ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 5 files, +157 −15 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 484 passed (1 min 1 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (2 min 12 s) | | tests: horizon-client, horizon-mods | ✅ 1308 passed (4 min 57 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 10 s) | | launcher tests | ✅ 300 passed (2 min 11 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:05 +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#5941
No description provided.