[PR #3369] [MERGED] port-pack: upgrade-datapack, a 26.2 data pack's registries in 26.3's formats #4937

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3369
Author: @ThatCakeIsAPie
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: feat/upgrade-datapack-1


📝 Commits (2)

  • 81b3803 port-pack: upgrade-datapack, a 26.2 data pack's registries in 26.3's formats
  • 0771f59 upgrade-datapack: refuse pack entries that leave the pack

📊 Changes

6 files changed (+720 additions, -3 deletions)

View changed files

📝 crates/horizon-port-pack/Cargo.toml (+3 -1)
📝 crates/horizon-port-pack/src/lib.rs (+1 -0)
📝 crates/horizon-port-pack/src/main.rs (+22 -2)
➕ crates/horizon-port-pack/src/upgrade/mod.rs (+422 -0)
➕ crates/horizon-port-pack/src/upgrade/noise.rs (+104 -0)
➕ crates/horizon-port-pack/src/upgrade/registries.rs (+168 -0)

📄 Description

🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself.

What and why

Vanilla 26.3 refuses a world generation data pack written for 26.2: the worldgen registries changed format, and the server logs registry errors on load. Many worldgen packs on Modrinth are still 26.2 packs. This adds horizon-port-pack upgrade-datapack <pack> (<out> | --world <world>). It reads a pack (zip or folder) and writes it in 26.3's formats. It prints a report of what it rewrote, what has no faithful 26.3 form, and which types it doesn't know. Nothing is downloaded, and the pack stays on the player's machine.

This is part 1 of 5 (stacked, each builds and passes its tests on its own):

  1. this PR: the command and the registries that need no context: noise parameters, block states, carvers, biomes, structures, dimension types;
  2. feat/upgrade-datapack-2a: density functions;
  3. feat/upgrade-datapack-2b: noise settings, dimensions and world presets;
  4. feat/upgrade-datapack-3: features and placed features;
  5. feat/upgrade-datapack-4: docs/datapack-upgrade.md, and two checks against vanilla (tools/datapack_upgrade_rosetta.py, tools/datapack_upgrade_fidelity.py).

Each rewrite is the one vanilla's own data went through between 26.2 and 26.3:

  • noise parameters: firstOctave/amplitudes become base_octave, octave_count, amplitude_modifiers and the base amplitude of NormalNoise.createParity, which keeps 26.2's normalisation (all 63 vanilla noises come out identical to 26.3's);
  • block states: {Name, Properties} become {id, properties}, or the bare id;
  • configured carvers move to carver/ with config unwrapped, and the cave carvers' hard-coded count, thickness and room scale written out (all 4 vanilla carvers come out identical to 26.3's);
  • biome spawners/spawn_costs and creature_spawn_probability become 26.3's gameplay attributes;
  • structure spawn override counts, and the dimension type's bed_rule.explodes (now destroy_on_use).

serde_json gains float_roundtrip in this crate, so the numbers the upgrade writes back are the ones it read. Note that Cargo unifies features, so a --workspace build gets it everywhere.

Horizon itself doesn't apply a data pack's world generation yet (docs/mod-browser.md). On its own, an upgraded pack's worldgen applies once Horizon reads data pack worldgen. Until then, the upgraded pack loads in vanilla 26.3, which is what the checks in part 5 run.

Vanilla reference

NormalNoise.createParity, computeParityBaseAmplitude, buildOctaves (noise); the 26.2 and 26.3 data jars' data/minecraft/worldgen/** (formats). The vanilla comparison is tools/datapack_upgrade_rosetta.py in part 5. It writes vanilla 26.2's own worldgen out as a pack, upgrades it, and compares it with 26.3's file by file. No gameplay change and no harness: this is tooling.

Tested on: the 26.2 world generation pack To The Max (not redistributable, so not in the repo) and vanilla 26.2's own worldgen. No other third-party 26.2 packs have been tried yet.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at e1b2b0b2f, 16 min 38 s)

Check Result
Scope ⚠️ 6 files, +674 −3; 677 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 401 run, FAILED (failures=1, errors=1, skipped=1) (5 min 5 s)
rustfmt ✅ (29 s)
clippy ✅ (2 min 35 s)
tests: horizon-port-pack ✅ 71 passed (41 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (3 s)
launcher clippy ❌ failed (1 min 31 s)
launcher tests ✅ 212 passed (5 min 53 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)

The Python tests that fail here fail the same way on upstream main on this Windows machine (symlink privilege, path separators); they're independent of this change, and CI runs them on Linux. Launcher clippy fails on Windows on upstream main too: an unused CommandExt import in launcher/src/sources.rs (9f1fa0a0a), which this change doesn't touch; #3363 removes it.

Label: skip-release (tooling; players see no change).

🤖 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/3369 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/upgrade-datapack-1` --- ### 📝 Commits (2) - [`81b3803`](https://github.com/horizon-rust/horizon/commit/81b38030176f5e9e8beac500403a80265e88ce64) port-pack: upgrade-datapack, a 26.2 data pack's registries in 26.3's formats - [`0771f59`](https://github.com/horizon-rust/horizon/commit/0771f59bca57243d668e2aafbed932dfe25f38d6) upgrade-datapack: refuse pack entries that leave the pack ### 📊 Changes **6 files changed** (+720 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-port-pack/Cargo.toml` (+3 -1) 📝 `crates/horizon-port-pack/src/lib.rs` (+1 -0) 📝 `crates/horizon-port-pack/src/main.rs` (+22 -2) ➕ `crates/horizon-port-pack/src/upgrade/mod.rs` (+422 -0) ➕ `crates/horizon-port-pack/src/upgrade/noise.rs` (+104 -0) ➕ `crates/horizon-port-pack/src/upgrade/registries.rs` (+168 -0) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. ## What and why Vanilla 26.3 refuses a world generation data pack written for 26.2: the worldgen registries changed format, and the server logs registry errors on load. Many worldgen packs on Modrinth are still 26.2 packs. This adds `horizon-port-pack upgrade-datapack <pack> (<out> | --world <world>)`. It reads a pack (zip or folder) and writes it in 26.3's formats. It prints a report of what it rewrote, what has no faithful 26.3 form, and which types it doesn't know. Nothing is downloaded, and the pack stays on the player's machine. This is part 1 of 5 (stacked, each builds and passes its tests on its own): 1. **this PR**: the command and the registries that need no context: noise parameters, block states, carvers, biomes, structures, dimension types; 2. `feat/upgrade-datapack-2a`: density functions; 3. `feat/upgrade-datapack-2b`: noise settings, dimensions and world presets; 4. `feat/upgrade-datapack-3`: features and placed features; 5. `feat/upgrade-datapack-4`: `docs/datapack-upgrade.md`, and two checks against vanilla (`tools/datapack_upgrade_rosetta.py`, `tools/datapack_upgrade_fidelity.py`). Each rewrite is the one vanilla's own data went through between 26.2 and 26.3: - noise parameters: `firstOctave`/`amplitudes` become `base_octave`, `octave_count`, `amplitude_modifiers` and the base amplitude of `NormalNoise.createParity`, which keeps 26.2's normalisation (all 63 vanilla noises come out identical to 26.3's); - block states: `{Name, Properties}` become `{id, properties}`, or the bare id; - configured carvers move to `carver/` with `config` unwrapped, and the cave carvers' hard-coded count, thickness and room scale written out (all 4 vanilla carvers come out identical to 26.3's); - biome `spawners`/`spawn_costs` and `creature_spawn_probability` become 26.3's gameplay attributes; - structure spawn override counts, and the dimension type's `bed_rule.explodes` (now `destroy_on_use`). `serde_json` gains `float_roundtrip` in this crate, so the numbers the upgrade writes back are the ones it read. Note that Cargo unifies features, so a `--workspace` build gets it everywhere. Horizon itself doesn't apply a data pack's world generation yet (`docs/mod-browser.md`). On its own, an upgraded pack's worldgen applies once Horizon reads data pack worldgen. Until then, the upgraded pack loads in vanilla 26.3, which is what the checks in part 5 run. ## Vanilla reference `NormalNoise.createParity`, `computeParityBaseAmplitude`, `buildOctaves` (noise); the 26.2 and 26.3 data jars' `data/minecraft/worldgen/**` (formats). The vanilla comparison is `tools/datapack_upgrade_rosetta.py` in part 5. It writes vanilla 26.2's own worldgen out as a pack, upgrades it, and compares it with 26.3's file by file. No gameplay change and no harness: this is tooling. Tested on: the 26.2 world generation pack *To The Max* (not redistributable, so not in the repo) and vanilla 26.2's own worldgen. No other third-party 26.2 packs have been tried yet. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at e1b2b0b2f, 16 min 38 s) | Check | Result | | --- | --- | | Scope | ⚠️ 6 files, +674 −3; 677 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 401 run, FAILED (failures=1, errors=1, skipped=1) (5 min 5 s) | | rustfmt | ✅ (29 s) | | clippy | ✅ (2 min 35 s) | | tests: horizon-port-pack | ✅ 71 passed (41 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (3 s) | | launcher clippy | ❌ failed (1 min 31 s) | | launcher tests | ✅ 212 passed (5 min 53 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) | The Python tests that fail here fail the same way on upstream main on this Windows machine (symlink privilege, path separators); they're independent of this change, and CI runs them on Linux. Launcher clippy fails on Windows on upstream main too: an unused `CommandExt` import in `launcher/src/sources.rs` (9f1fa0a0a), which this change doesn't touch; #3363 removes it. Label: `skip-release` (tooling; players see no change). 🤖 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:09:02 +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#4937
No description provided.