[PR #3478] [MERGED] Data packs: a world's packs change its world generation #5008

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

📋 Pull Request Information

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

Base: main ← Head: feat/datapack-worldgen-3


📝 Commits (5)

  • d1ef7b4 Worldgen: data packs' entries over the prepared bundles
  • 2566257 Worldgen: the generator loads a world's data packs over the bundles
  • b0e65de Data packs: a world's packs change its world generation
  • 69fc342 Merge remote-tracking branch 'origin/main' into upd/3478
  • b65c319 Merge main into the branch

📊 Changes

7 files changed (+798 additions, -46 deletions)

View changed files

📝 crates/horizon-client-render/src/biome.rs (+4 -0)
📝 crates/horizon-client-render/src/datapack.rs (+133 -1)
📝 crates/horizon-client/src/game/world_loading.rs (+27 -2)
📝 crates/horizon-client/src/vanillagen.rs (+59 -6)
📝 crates/horizon-world/src/worldgen.rs (+1 -0)
📝 crates/horizon-world/src/worldgen/generator.rs (+208 -37)
➕ crates/horizon-world/src/worldgen/overrides.rs (+366 -0)

📄 Description

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

Builds on #3477 (feat/datapack-worldgen-2): until that merges, its commits show here too; this PR's own change is the commit(s) on top.

What and why

Part 3 of 4. Parts 1 and 2 taught the generator to read data packs. This part passes it the world's packs, so a worldgen data pack in <world>/datapacks changes the world's terrain, caves, features and structures, as in vanilla.

  • datapack::enabled_ids is the enabled packs from datapacks.json, lowest first: listed as enabled in its order, then packs listed neither way, by name. It reads the file as /datapack does.
  • datapack::worldgen_overrides reads the enabled packs' dimension, dimension_type, tags and worldgen folders (folders and zips) into WorldgenOverrides. Biomes::contains says which biomes the game has, so a pack's new biome is left out.
  • make_streaming builds VanillaTerrain::for_world_with with them. If loading fails with packs, the error says a pack may not be made for this version, instead of telling the player to prepare again.
  • vanillagen::shared_data_with keeps one GeneratorData per bundle and set of pack entries: the plain one (which the world screens preload) and the two most recent with packs. forget_shared_data still drops them all.
  • The log lists what Horizon leaves out: new biomes and what names them, dimension types (every level keeps its vanilla height), folders the generator doesn't read (26.2 names, world presets...), pack tags naming something missing, and noise settings taller than the level ("only y -64..320 generates").

A world without data packs reads the same bundle as before. Not in this PR: sapling growth and bone meal (game/growth.rs) still place vanilla's features, and the launcher's data pack installer still counts worldgen files as "not read yet" (launcher/src/datapacks.rs READ).

Open PRs nearby: #2949 and #2570 (world presets) edit the same lines of world_loading.rs and vanillagen.rs, where the generator is built; #3300 already conflicts with main in world_loading.rs. #3325 (the Data Packs screen) and #3300 also add to datapack.rs and merge cleanly with it. /datapack's own reading of datapacks.json (game/functions.rs) is left alone, since #3300 reworks that code. The overlap is in text only, not in what they do; whichever lands second needs a rebase.

Vanilla reference

WorldLoader / WorldDataConfiguration: the selected packs (vanilla first) build the registries the world generates with. PackRepository order: the enabled list, in order.

Self-check

Tests

datapack::tests::enabled_packs_override_worldgen_in_order: three packs, one disabled. The later enabled pack's noise wins, tag files arrive in pack order, a new biome is left out, and the warnings name the dimension type, the new biome and the world preset folder. The generation itself is checked against vanilla in part 4.

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at fe3333f3f, 17 min 55 s)

Check Result
Scope ⚠️ 7 files, +795 −46; 841 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 408 run, FAILED (failures=1, skipped=2) (1 min 39 s)
rustfmt ✅ (12 s)
clippy ✅ (2 min 36 s)
tests: horizon-client, horizon-world ❌ 1112 passed, 1 failed (10 min 41 s)
doc tests ✅ 0 passed (2 min 36 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)

The Scope row counts the whole stack against upstream main; this PR's own part (over feat/datapack-worldgen-2) is 4 files, +220 −9, 229 lines of code.

test_port_publish's test_body_has_names_and_signatures_only fails on upstream main on this Windows machine too (it expects / in a path); CI runs the Python tests on Linux.

save::tests::session_lock_is_exclusive fails on upstream main here too (Windows only).

Suggested label: feature.

🤖 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/3478 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `feat/datapack-worldgen-3` --- ### 📝 Commits (5) - [`d1ef7b4`](https://github.com/horizon-rust/horizon/commit/d1ef7b4fb0f6eb9c642837d9941ef986129b93cc) Worldgen: data packs' entries over the prepared bundles - [`2566257`](https://github.com/horizon-rust/horizon/commit/25662576ff54bf5f4e2600ae0c5a1c588c911cb6) Worldgen: the generator loads a world's data packs over the bundles - [`b0e65de`](https://github.com/horizon-rust/horizon/commit/b0e65dec064bb142152fb6445fb5661aeac59ff0) Data packs: a world's packs change its world generation - [`69fc342`](https://github.com/horizon-rust/horizon/commit/69fc342a1a179d67d2c16c1537fc1e494516efbb) Merge remote-tracking branch 'origin/main' into upd/3478 - [`b65c319`](https://github.com/horizon-rust/horizon/commit/b65c319b2a38fcebf557870bb470a25b45ada98f) Merge main into the branch ### 📊 Changes **7 files changed** (+798 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/biome.rs` (+4 -0) 📝 `crates/horizon-client-render/src/datapack.rs` (+133 -1) 📝 `crates/horizon-client/src/game/world_loading.rs` (+27 -2) 📝 `crates/horizon-client/src/vanillagen.rs` (+59 -6) 📝 `crates/horizon-world/src/worldgen.rs` (+1 -0) 📝 `crates/horizon-world/src/worldgen/generator.rs` (+208 -37) ➕ `crates/horizon-world/src/worldgen/overrides.rs` (+366 -0) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3477 (`feat/datapack-worldgen-2`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 3 of 4. Parts 1 and 2 taught the generator to read data packs. This part passes it the world's packs, so a worldgen data pack in `<world>/datapacks` changes the world's terrain, caves, features and structures, as in vanilla. - `datapack::enabled_ids` is the enabled packs from `datapacks.json`, lowest first: listed as enabled in its order, then packs listed neither way, by name. It reads the file as `/datapack` does. - `datapack::worldgen_overrides` reads the enabled packs' `dimension`, `dimension_type`, `tags` and `worldgen` folders (folders and zips) into `WorldgenOverrides`. `Biomes::contains` says which biomes the game has, so a pack's new biome is left out. - `make_streaming` builds `VanillaTerrain::for_world_with` with them. If loading fails with packs, the error says a pack may not be made for this version, instead of telling the player to prepare again. - `vanillagen::shared_data_with` keeps one `GeneratorData` per bundle and set of pack entries: the plain one (which the world screens preload) and the two most recent with packs. `forget_shared_data` still drops them all. - The log lists what Horizon leaves out: new biomes and what names them, dimension types (every level keeps its vanilla height), folders the generator doesn't read (26.2 names, world presets...), pack tags naming something missing, and noise settings taller than the level ("only y -64..320 generates"). A world without data packs reads the same bundle as before. Not in this PR: sapling growth and bone meal (`game/growth.rs`) still place vanilla's features, and the launcher's data pack installer still counts worldgen files as "not read yet" (`launcher/src/datapacks.rs` `READ`). **Open PRs nearby:** #2949 and #2570 (world presets) edit the same lines of `world_loading.rs` and `vanillagen.rs`, where the generator is built; #3300 already conflicts with main in `world_loading.rs`. #3325 (the Data Packs screen) and #3300 also add to `datapack.rs` and merge cleanly with it. `/datapack`'s own reading of `datapacks.json` (`game/functions.rs`) is left alone, since #3300 reworks that code. The overlap is in text only, not in what they do; whichever lands second needs a rebase. ## Vanilla reference `WorldLoader` / `WorldDataConfiguration`: the selected packs (vanilla first) build the registries the world generates with. `PackRepository` order: the enabled list, in order. ## Self-check **Tests** `datapack::tests::enabled_packs_override_worldgen_in_order`: three packs, one disabled. The later enabled pack's noise wins, tag files arrive in pack order, a new biome is left out, and the warnings name the dimension type, the new biome and the world preset folder. The generation itself is checked against vanilla in part 4. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at fe3333f3f, 17 min 55 s) | Check | Result | | --- | --- | | Scope | ⚠️ 7 files, +795 −46; 841 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 408 run, FAILED (failures=1, skipped=2) (1 min 39 s) | | rustfmt | ✅ (12 s) | | clippy | ✅ (2 min 36 s) | | tests: horizon-client, horizon-world | ❌ 1112 passed, 1 failed (10 min 41 s) | | doc tests | ✅ 0 passed (2 min 36 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) | The Scope row counts the whole stack against upstream main; this PR's own part (over `feat/datapack-worldgen-2`) is 4 files, +220 −9, 229 lines of code. `test_port_publish`'s `test_body_has_names_and_signatures_only` fails on upstream main on this Windows machine too (it expects `/` in a path); CI runs the Python tests on Linux. `save::tests::session_lock_is_exclusive` fails on upstream main here too (Windows only). Suggested label: `feature`. 🤖 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:33 +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#5008
No description provided.