[PR #4555] [MERGED] Send the world's data pack dialogs in the dialog registry #5693

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4555
Author: @AurelienBelloir
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: parity/data-pack-dialogs


📝 Commits (6)

  • 12a1007 Send the world's data pack dialogs in the dialog registry
  • 32a35d1 Merge remote-tracking branch 'origin/main' into parity/data-pack-dialogs
  • cf2c6dd Order the dialog registry by file id and drop a pack world's sync data
  • 456bbcc Keep the synchronized registries on /reload
  • c5bf7a3 Key the reloaded sync data by the pack dialogs it keeps
  • 6dd82d9 Merge remote-tracking branch 'origin/main' into parity/data-pack-dialogs

📊 Changes

4 files changed (+246 additions, -28 deletions)

View changed files

📝 crates/horizon-client-render/src/datapack.rs (+13 -3)
📝 crates/horizon-client/src/game.rs (+21 -8)
📝 crates/horizon-client/src/game/lan.rs (+66 -10)
📝 crates/horizon-client/src/lan/data.rs (+146 -7)

📄 Description

🤖 Opened by AurelienBelloir's AI agent (Claude Code, Claude Opus 5.5), not by AurelienBelloir personally.

What and why

The data pack dialogs in data/<ns>/dialog/ never reached the synchronized minecraft:dialog registry, so /dialog show @s <pack>:<id> could not open them. BlazeandCave's Advancements Pack uses 7 of them for its points settings.

  • DataStore::load (horizon-client-render/src/datapack.rs) now also reads dialog/ files into the content overlay, next to recipes, loot tables and advancements.
  • SyncData::load (lan/data.rs) merges the overlay's dialogs over the game's own (pack_entries): the top pack's file wins for an id, and entries are sorted like ResourceManagerRegistryLoadTask, by Identifier, which compares the path first and then the namespace. Pack entries are marked from_pack, and registry_packets always sends their data, even to clients that know the core pack. Only minecraft:dialog takes pack entries (PACK_REGISTRIES); the other synchronized registries keep the game's own data, which is what Horizon's gameplay reads.
  • Game::sync_dialog_ids sets the commands' minecraft:dialog ids from that same SyncData, so /dialog show parses a pack's id and sends the index the clients hold. It runs when a world opens and on /reload.
  • Opening a world with packs now drops the SyncData the world-screen preload read with no packs. Before, a world opened after the preload sent its clients registries without its packs' recipes, advancements and dialogs.

Fixes #4554

Not covered, to keep this small:

  • dialog tags from packs (tags/dialog, e.g. pause_screen_additions);
  • /reload with players connected. Vanilla never reloads synchronized registries, but here a reload rebuilds SyncData for the next joiners, while connected players keep the list they got.

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

Read from the 26.3 bytecode with javap -c:

  • ResourceManagerRegistryLoadTask: FileToIdConverter.listMatchingResources (top pack per id), entries sorted(Map.Entry.comparingByKey()), then registerElements.
  • Identifier.compareTo: path.compareTo, then namespace.compareTo.

Tests:

  • lan::data::tests::pack_dialogs_join_the_registry_in_identifier_order: path-first order, a pack overriding a vanilla entry with its top file, from_pack, unreadable JSON skipped, other kinds ignored.
  • datapack::tests::packs_provide_functions_and_tags now also checks that a dialog/ file reaches DataStore.files.

Self-check

The full tools/pr_ready.py needs more disk than this machine has (see #4543). Checks run by hand on Windows with prepared 26.3 resources (CARGO_INCREMENTAL=0, -j 2):

  • rustfmt: ✅
  • cargo clippy -p horizon-client-render -p horizon-client --all-targets -- -D warnings: ✅
  • cargo test --no-fail-fast -p horizon-client-render -p horizon-client --lib --bins --tests:
    • horizon-client-render lib: 586 passed;
    • horizon-client lib: 781 passed, 1 failed (title::tests::each_world_preset_writes_its_own_generator, Windows-only and already failing on main, fixed by #4544);
    • horizon-client bin: 240 passed; horizon-ctl: 18 passed; all integration suites pass.
  • Public tree hook: ✅

🤖 Generated with Claude Code


🔄 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/4555 **Author:** [@AurelienBelloir](https://github.com/AurelienBelloir) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `parity/data-pack-dialogs` --- ### 📝 Commits (6) - [`12a1007`](https://github.com/horizon-rust/horizon/commit/12a100719af93605865310e1eedc35a7c0c8a4e1) Send the world's data pack dialogs in the dialog registry - [`32a35d1`](https://github.com/horizon-rust/horizon/commit/32a35d1225fc681a544a5b1e76a1160e9a6d0ef5) Merge remote-tracking branch 'origin/main' into parity/data-pack-dialogs - [`cf2c6dd`](https://github.com/horizon-rust/horizon/commit/cf2c6dd7cb24a8a8dd5538460c41c78f3246112d) Order the dialog registry by file id and drop a pack world's sync data - [`456bbcc`](https://github.com/horizon-rust/horizon/commit/456bbccd1d612a4ca76845e8cb3f6cc9171cab7a) Keep the synchronized registries on /reload - [`c5bf7a3`](https://github.com/horizon-rust/horizon/commit/c5bf7a35cdb8a74957eef67ea1914e5ee8bde310) Key the reloaded sync data by the pack dialogs it keeps - [`6dd82d9`](https://github.com/horizon-rust/horizon/commit/6dd82d9d303479f27465caeb86630c8c2ee00ef6) Merge remote-tracking branch 'origin/main' into parity/data-pack-dialogs ### 📊 Changes **4 files changed** (+246 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/datapack.rs` (+13 -3) 📝 `crates/horizon-client/src/game.rs` (+21 -8) 📝 `crates/horizon-client/src/game/lan.rs` (+66 -10) 📝 `crates/horizon-client/src/lan/data.rs` (+146 -7) </details> ### 📄 Description > 🤖 Opened by AurelienBelloir's AI agent (Claude Code, Claude Opus 5.5), not by AurelienBelloir personally. ## What and why The data pack dialogs in `data/<ns>/dialog/` never reached the synchronized `minecraft:dialog` registry, so `/dialog show @s <pack>:<id>` could not open them. BlazeandCave's Advancements Pack uses 7 of them for its points settings. - `DataStore::load` (horizon-client-render/src/datapack.rs) now also reads `dialog/` files into the content overlay, next to recipes, loot tables and advancements. - `SyncData::load` (lan/data.rs) merges the overlay's dialogs over the game's own (`pack_entries`): the top pack's file wins for an id, and entries are sorted like `ResourceManagerRegistryLoadTask`, by `Identifier`, which compares the path first and then the namespace. Pack entries are marked `from_pack`, and `registry_packets` always sends their data, even to clients that know the core pack. Only `minecraft:dialog` takes pack entries (`PACK_REGISTRIES`); the other synchronized registries keep the game's own data, which is what Horizon's gameplay reads. - `Game::sync_dialog_ids` sets the commands' `minecraft:dialog` ids from that same `SyncData`, so `/dialog show` parses a pack's id and sends the index the clients hold. It runs when a world opens and on `/reload`. - Opening a world with packs now drops the `SyncData` the world-screen preload read with no packs. Before, a world opened after the preload sent its clients registries without its packs' recipes, advancements and dialogs. Fixes #4554 Not covered, to keep this small: - dialog tags from packs (`tags/dialog`, e.g. `pause_screen_additions`); - `/reload` with players connected. Vanilla never reloads synchronized registries, but here a reload rebuilds `SyncData` for the next joiners, while connected players keep the list they got. ## Kind - [x] 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 Read from the 26.3 bytecode with `javap -c`: - `ResourceManagerRegistryLoadTask`: `FileToIdConverter.listMatchingResources` (top pack per id), entries `sorted(Map.Entry.comparingByKey())`, then `registerElements`. - `Identifier.compareTo`: `path.compareTo`, then `namespace.compareTo`. Tests: - `lan::data::tests::pack_dialogs_join_the_registry_in_identifier_order`: path-first order, a pack overriding a vanilla entry with its top file, `from_pack`, unreadable JSON skipped, other kinds ignored. - `datapack::tests::packs_provide_functions_and_tags` now also checks that a `dialog/` file reaches `DataStore.files`. ## Self-check The full `tools/pr_ready.py` needs more disk than this machine has (see #4543). Checks run by hand on Windows with prepared 26.3 resources (`CARGO_INCREMENTAL=0`, `-j 2`): - rustfmt: ✅ - `cargo clippy -p horizon-client-render -p horizon-client --all-targets -- -D warnings`: ✅ - `cargo test --no-fail-fast -p horizon-client-render -p horizon-client --lib --bins --tests`: - horizon-client-render lib: 586 passed; - horizon-client lib: 781 passed, 1 failed (`title::tests::each_world_preset_writes_its_own_generator`, Windows-only and already failing on main, fixed by #4544); - horizon-client bin: 240 passed; horizon-ctl: 18 passed; all integration suites pass. - Public tree hook: ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:21 +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#5693
No description provided.