[PR #6012] [MERGED] /datapack enable and disable reload the server's data, as /reload does #6607

Closed
opened 2026-11-03 06:23:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6012
Author: @Sylviromi
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: datapack-command-reload


📝 Commits (1)

  • 0db0837 /datapack enable and disable reload the server's data, as /reload does

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/functions.rs (+4 -1)

📄 Description

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

What and why

Vanilla 26.3 /datapack enable and /datapack disable both end in ReloadCommand.reloadPacks, which reloads the server's resources (recipes, tags, loot, advancements) as /reload does.

Horizon's apply_pack_change rebuilt only the function store, so a pack's recipes stayed in (after a disable) or stayed out (after an enable) until the next /reload. The comment at functions.rs:134 already claimed /datapack reloads the tables.

The fix calls reload_world_tables there, as reload_datapacks(true) does for /reload. That also sends players the reloaded tags and recipes. Four lines in crates/horizon-client/src/game/functions.rs.

Fixes #5995. The gap was also seen in the in-game test on #5902 (https://github.com/horizon-rust/horizon/pull/5902), where it predates that PR. Once both merge, /datapack enable and disable rebuild the tables and fire native_server_data_loaded with reload = true, as /reload does.

Label: none (a fix).

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

DataPackCommand (enable and disable) ending in ReloadCommand.reloadPacks; Horizon's /reload path is reload_datapacks.

Harness: none. This is a data reload with no random draws and no tick order, so there is no Java oracle output to compare, and the existing command harnesses (test_command_exec_parity.py) compare command results, not the recipes a reload leaves in the tables. CONTRIBUTING asks for a harness on gameplay changes; I did not add one here, so a maintainer may want to say if one is required.

In-game proof instead: offscreen single player, a world data pack adding a smelting recipe apple -> diamond, a furnace read with data get block, no /reload between steps (the one /reload at the start loads the pack, which was added after the world was created). Built from this branch's commit:

E. pack on:        [{count: 1, Slot: 2b, id: "minecraft:diamond"}]
disable: Disabling data pack [file/cmd-proof (world)]
D. after disable:  [{count: 1, Slot: 0b, id: "minecraft:apple"}, {count: 1, Slot: 1b, id: "minecraft:coal"}]
enable: Enabling data pack [file/cmd-proof (world)]
R. after enable:   [{count: 1, Slot: 2b, id: "minecraft:diamond"}]

The apple is smelted with the pack on, left alone after /datapack disable, and smelted again after /datapack enable. I did not run the same steps on main to show the failing "before"; the in-game test on #5902 observed it.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on boilingpoint, against origin/main at ebf11e243, 5 min 57 s)

Check Result
Scope ✅ 1 files, +4 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (46 s)
rustfmt ✅ (14 s)
clippy ✅ (2 min 30 s)
tests: horizon-client ✅ 1699 passed (2 min 24 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
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)

🤖 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/6012 **Author:** [@Sylviromi](https://github.com/Sylviromi) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `datapack-command-reload` --- ### 📝 Commits (1) - [`0db0837`](https://github.com/horizon-rust/horizon/commit/0db0837641e1c06fd920a910fe92b445081c09a5) /datapack enable and disable reload the server's data, as /reload does ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/functions.rs` (+4 -1) </details> ### 📄 Description > 🤖 Opened by Sylviromi's AI agent (Claude Code, Sonnet 5.5), not by Sylviromi personally. ## What and why Vanilla 26.3 `/datapack enable` and `/datapack disable` both end in `ReloadCommand.reloadPacks`, which reloads the server's resources (recipes, tags, loot, advancements) as `/reload` does. Horizon's `apply_pack_change` rebuilt only the function store, so a pack's recipes stayed in (after a disable) or stayed out (after an enable) until the next `/reload`. The comment at `functions.rs:134` already claimed `/datapack` reloads the tables. The fix calls `reload_world_tables` there, as `reload_datapacks(true)` does for `/reload`. That also sends players the reloaded tags and recipes. Four lines in `crates/horizon-client/src/game/functions.rs`. Fixes #5995. The gap was also seen in the in-game test on #5902 (https://github.com/horizon-rust/horizon/pull/5902), where it predates that PR. Once both merge, `/datapack enable` and `disable` rebuild the tables and fire `native_server_data_loaded` with `reload = true`, as `/reload` does. Label: none (a fix). ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] 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 `DataPackCommand` (enable and disable) ending in `ReloadCommand.reloadPacks`; Horizon's `/reload` path is `reload_datapacks`. Harness: none. This is a data reload with no random draws and no tick order, so there is no Java oracle output to compare, and the existing command harnesses (`test_command_exec_parity.py`) compare command results, not the recipes a reload leaves in the tables. CONTRIBUTING asks for a harness on gameplay changes; I did not add one here, so a maintainer may want to say if one is required. In-game proof instead: offscreen single player, a world data pack adding a smelting recipe apple -> diamond, a furnace read with `data get block`, no `/reload` between steps (the one `/reload` at the start loads the pack, which was added after the world was created). Built from this branch's commit: ``` E. pack on: [{count: 1, Slot: 2b, id: "minecraft:diamond"}] disable: Disabling data pack [file/cmd-proof (world)] D. after disable: [{count: 1, Slot: 0b, id: "minecraft:apple"}, {count: 1, Slot: 1b, id: "minecraft:coal"}] enable: Enabling data pack [file/cmd-proof (world)] R. after enable: [{count: 1, Slot: 2b, id: "minecraft:diamond"}] ``` The apple is smelted with the pack on, left alone after `/datapack disable`, and smelted again after `/datapack enable`. I did not run the same steps on `main` to show the failing "before"; the in-game test on #5902 observed it. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on boilingpoint, against origin/main at ebf11e243, 5 min 57 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +4 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (46 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (2 min 30 s) | | tests: horizon-client | ✅ 1699 passed (2 min 24 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | 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) | 🤖 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 06:23:44 +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#6607
No description provided.