[PR #4333] [CLOSED] Data packs: apply the world's packs to trades, banners, enchantments, songs and trims #5565

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4333
Author: @masa-masa-0314
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: fix/datapack-registry-pack-overlay


📝 Commits (1)

  • aa77b83 Data packs: load the world's packs into the registry tables

📊 Changes

19 files changed (+242 additions, -106 deletions)

View changed files

📝 crates/horizon-client-render/src/datapack.rs (+13 -2)
📝 crates/horizon-client/examples/probe/block_entity_render_fixture.rs (+2 -1)
📝 crates/horizon-client/examples/probe/enchanting_fixture.rs (+1 -1)
📝 crates/horizon-client/examples/probe/finalize_spawn_fixture.rs (+1 -1)
📝 crates/horizon-client/examples/probe/firework_tooltip_fixture.rs (+2 -1)
📝 crates/horizon-client/examples/probe/menu_fixture.rs (+2 -2)
📝 crates/horizon-client/examples/probe/recipe_fixture.rs (+1 -1)
📝 crates/horizon-client/examples/probe/screen_layout_fixture.rs (+2 -1)
📝 crates/horizon-client/examples/probe/trading_fixture.rs (+3 -3)
📝 crates/horizon-client/src/banner.rs (+105 -43)
📝 crates/horizon-client/src/game/remote.rs (+1 -1)
📝 crates/horizon-client/src/item_tooltip.rs (+3 -3)
📝 crates/horizon-client/src/menu.rs (+1 -1)
📝 crates/horizon-client/src/merchant.rs (+18 -3)
📝 crates/horizon-client/src/stations.rs (+24 -20)
📝 crates/horizon-client/src/vanillagen/structure_mobs.rs (+1 -1)
📝 crates/horizon-items/src/enchant.rs (+17 -5)
📝 crates/horizon-items/src/items.rs (+22 -16)
📝 crates/horizon-world/src/loot.rs (+23 -0)

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally.

What and why

The village, banner and item registries now take the world's data packs over
the game's own, as #3300 did for recipes, loot and tags: villager trades and
their sets, banner patterns and their tags, enchantments with the enchanting /
entity / damage tags, jukebox songs and trim materials
.

Layering is the pack stack's, as #3300's: a pack's file replaces the game's for
the same id (SimpleJsonResourceReloadListener), tag files join with replace
dropping the lower sources (TagLoader.load), and every registry reads in id
order.

Mechanically the new kinds join datapack::DataStore.files (trade_set,
villager_trade, enchantment, banner_pattern, trim_pattern,
trim_material, jukebox_song) and reach the loaders through
PackOverlay: Trades::load, Banners::load (its tags now read through one
raw map instead of a file per lookup), Enchantments::load, load_songs, and
StationRecipes' trim materials. All of them hang off Items or
StationData, so the world tables' rebuild at world open and on /reload
already covers them.

Not covered yet: dimension_type and timelines (loaded with the core
resources), spawn variants, trial spawners, dialog and chat_type.

Vanilla reference

  • net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener.prepare
    — one resource per id, the top of the stack.
  • net.minecraft.tags.TagLoader.load / tryBuildTag — entries joined bottom
    to top, replace clearing lower packs, first-occurrence order.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on DESKTOP-3050AHP, against upstream/main at 33f417fb3)

Check Result
Scope ✅ 19 files, +242 −106
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 480 run, FAILED (errors=1, skipped=1)
rustfmt ✅
clippy ✅
tests: horizon-client, horizon-client-render, horizon-items, horizon-world ❌ 726 passed, 1 failed
doc tests ✅
content root tests ✅
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses

Both failures are pre-existing on this Windows machine, not this change: the
horizon-client one is title::tests::each_world_preset_writes_its_own_generator,
which makes a folder named after a preset id (minecraft:normal — a : is not
a valid path character here) — it fails on clean upstream/main the same way;
the Python one is the test_parity_reach/test_port_harness set that fails on
clean upstream/main too (verified by stashing earlier).

Temporary tests for the layering (override per id, tag replace + union, the
no-pack fallback) were written, passed, and removed from this diff.

Screenshots

Not attached: data-driven — a pack's trade or enchantment shows in the menus a
screenshot would need a pack installed and a real screen to capture.


🔄 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/4333 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/datapack-registry-pack-overlay` --- ### 📝 Commits (1) - [`aa77b83`](https://github.com/horizon-rust/horizon/commit/aa77b830f01650943ea76f204bf9e543d7526383) Data packs: load the world's packs into the registry tables ### 📊 Changes **19 files changed** (+242 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/datapack.rs` (+13 -2) 📝 `crates/horizon-client/examples/probe/block_entity_render_fixture.rs` (+2 -1) 📝 `crates/horizon-client/examples/probe/enchanting_fixture.rs` (+1 -1) 📝 `crates/horizon-client/examples/probe/finalize_spawn_fixture.rs` (+1 -1) 📝 `crates/horizon-client/examples/probe/firework_tooltip_fixture.rs` (+2 -1) 📝 `crates/horizon-client/examples/probe/menu_fixture.rs` (+2 -2) 📝 `crates/horizon-client/examples/probe/recipe_fixture.rs` (+1 -1) 📝 `crates/horizon-client/examples/probe/screen_layout_fixture.rs` (+2 -1) 📝 `crates/horizon-client/examples/probe/trading_fixture.rs` (+3 -3) 📝 `crates/horizon-client/src/banner.rs` (+105 -43) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -1) 📝 `crates/horizon-client/src/item_tooltip.rs` (+3 -3) 📝 `crates/horizon-client/src/menu.rs` (+1 -1) 📝 `crates/horizon-client/src/merchant.rs` (+18 -3) 📝 `crates/horizon-client/src/stations.rs` (+24 -20) 📝 `crates/horizon-client/src/vanillagen/structure_mobs.rs` (+1 -1) 📝 `crates/horizon-items/src/enchant.rs` (+17 -5) 📝 `crates/horizon-items/src/items.rs` (+22 -16) 📝 `crates/horizon-world/src/loot.rs` (+23 -0) </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally. ## What and why The village, banner and item registries now take the world's data packs over the game's own, as #3300 did for recipes, loot and tags: **villager trades and their sets, banner patterns and their tags, enchantments with the enchanting / entity / damage tags, jukebox songs and trim materials**. Layering is the pack stack's, as #3300's: a pack's file replaces the game's for the same id (`SimpleJsonResourceReloadListener`), tag files join with `replace` dropping the lower sources (`TagLoader.load`), and every registry reads in id order. Mechanically the new kinds join `datapack::DataStore.files` (`trade_set`, `villager_trade`, `enchantment`, `banner_pattern`, `trim_pattern`, `trim_material`, `jukebox_song`) and reach the loaders through `PackOverlay`: `Trades::load`, `Banners::load` (its tags now read through one raw map instead of a file per lookup), `Enchantments::load`, `load_songs`, and `StationRecipes`' trim materials. All of them hang off `Items` or `StationData`, so the world tables' rebuild at world open and on `/reload` already covers them. Not covered yet: `dimension_type` and timelines (loaded with the core resources), spawn variants, trial spawners, `dialog` and `chat_type`. ## Vanilla reference - `net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener.prepare` — one resource per id, the top of the stack. - `net.minecraft.tags.TagLoader.load` / `tryBuildTag` — entries joined bottom to top, `replace` clearing lower packs, first-occurrence order. ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on DESKTOP-3050AHP, against upstream/main at 33f417fb3) | Check | Result | | --- | --- | | Scope | ✅ 19 files, +242 −106 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 480 run, FAILED (errors=1, skipped=1) | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client, horizon-client-render, horizon-items, horizon-world | ❌ 726 passed, 1 failed | | doc tests | ✅ | | content root tests | ✅ | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | Both failures are pre-existing on this Windows machine, not this change: the `horizon-client` one is `title::tests::each_world_preset_writes_its_own_generator`, which makes a folder named after a preset id (`minecraft:normal` — a `:` is not a valid path character here) — it fails on clean `upstream/main` the same way; the Python one is the `test_parity_reach`/`test_port_harness` set that fails on clean `upstream/main` too (verified by stashing earlier). Temporary tests for the layering (override per id, tag `replace` + union, the no-pack fallback) were written, passed, and removed from this diff. ## Screenshots Not attached: data-driven — a pack's trade or enchantment shows in the menus a screenshot would need a pack installed and a real screen to capture. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:27 +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#5565
No description provided.