[PR #3492] [CLOSED] A local world's biomes include its data packs': colours, spawns, generation, saves #5022

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3492
Author: @ThatCakeIsAPie
Created: 10/29/2026
Status: ❌ Closed

Base: main ← Head: feat/datapack-biomes-2


📝 Commits (10+)

  • 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
  • 0c63990 Section sets past 32 sections: SectionMask replaces the u32 column masks
  • a849545 Harness: chunks generated with a world's data packs against vanilla
  • 46c62bd LevelShape: each level's shape as one value, and the column its chunks hold
  • a6d8409 Light reads the chunk's column: flood fill, layers and relighting span its sections
  • c2b5547 World, streaming, meshing and the renderer read the level's column
  • fdb4e91 Saves read and write a chunk's own column, and SaveDir takes its level's shape
  • 9e91278 Chunk packets map between the level and the client's column by the level's shape

📊 Changes

120 files changed (+3598 additions, -754 deletions)

View changed files

📝 README.md (+1 -1)
📝 crates/horizon-client/examples/portal_scan_bench.rs (+5 -7)
📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+2 -2)
📝 crates/horizon-client/src/arrows.rs (+4 -4)
📝 crates/horizon-client/src/biome.rs (+233 -55)
📝 crates/horizon-client/src/chunk.rs (+356 -20)
📝 crates/horizon-client/src/chunk_map.rs (+3 -0)
📝 crates/horizon-client/src/collisions.rs (+1 -1)
📝 crates/horizon-client/src/datapack.rs (+131 -1)
📝 crates/horizon-client/src/entities/fluids.rs (+3 -3)
📝 crates/horizon-client/src/flatgen.rs (+16 -12)
📝 crates/horizon-client/src/game.rs (+66 -52)
📝 crates/horizon-client/src/game/agent.rs (+3 -2)
📝 crates/horizon-client/src/game/beacon.rs (+2 -2)
📝 crates/horizon-client/src/game/block_entity_anims.rs (+1 -1)
📝 crates/horizon-client/src/game/chat.rs (+1 -1)
📝 crates/horizon-client/src/game/commands.rs (+4 -6)
📝 crates/horizon-client/src/game/commands/execute.rs (+3 -3)
📝 crates/horizon-client/src/game/commands/terrain_cmds.rs (+3 -3)
📝 crates/horizon-client/src/game/commands/world_cmds.rs (+4 -4)

...and 80 more files

📄 Description

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

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

What and why

Part 2 of 4 of data-pack biomes.

  • Opening a world builds its biome table from the built-in biomes and its enabled packs' biome files (world_loading::set_world_biomes, Biomes::with_packs). It sets the table on the shared Resources, now behind a lock (Resources::set_biomes; biomes() returns an Arc), before the generator decides which pack biomes to keep. So a pack's new biomes generate, colour, spawn and save by name, instead of being left out.
  • Streaming and distant terrain take a worker context with that table (PackResources::context_with), and MobWorld holds the table it reads (an Arc).
  • worldgen::overrides now leaves out only a pack biome whose file the game couldn't read.
  • tools/fixtures/biome_datapacks/horizon_biome_test (MIT): three new biomes, one under minecraft: and two in their own namespace, with their own colours, spawns, features and climate points in a multi-noise Overworld level stem. The chunk generation oracle uses a pack's dimension/<id>.json generator, as a world created with the pack does.

A world without pack biomes gets the built-in table, as before.

Open PRs nearby: #3300 edits nearby lines of mob_ai_probe.rs, and #3263 of game.rs. The overlap is in text only, not in what they do; whichever lands second needs a rebase.

Vanilla reference

None

Self-check

Tests

HORIZON_PARITY_DATAPACKS=tools/fixtures/biome_datapacks python3 tools/test_datapack_worldgen_parity.py (8 min 35 s):

12345-terrain: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0)
12345-terrain: without the packs Horizon differs from them in 4 of 4 chunks (713 blocks)
4242-terrain: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0)
4242-terrain: without the packs Horizon differs from them in 4 of 4 chunks (3461 blocks)
12345-full: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0)
12345-full: without the packs Horizon differs from them in 4 of 4 chunks (16554 blocks)
4242-full: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0)
4242-full: without the packs Horizon differs from them in 4 of 4 chunks (15166 blocks)
Data pack worldgen parity passed

Plus the existing biome, data pack and mob tests.

Run before this branch was rebased from upstream/main 56f968e11 onto fe3333f3f. After the rebase, CI's two clippy commands pass on it again, and pr_ready was re-run at the top of its series (#3494).

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at 56f968e11, 15 min 29 s)

Check Result
Scope ⚠️ 121 files, +3590 −780; 3998 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 16 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 51 s)
tests: horizon-client, horizon-protocol, horizon-world ❌ 1107 passed, 2 failed (10 min 17 s)
doc tests ✅ 0 passed (1 min 48 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-biomes-1) is 21 files, +319 −56, 361 lines of code.

The Python tests fail on upstream main on this Windows machine too, more often there (main 56f968e11: failures=3, errors=13; path separators, symlink privilege). CI runs them on Linux.

crash::tests::stacks_start_at_the_panicking_frame and save::tests::session_lock_is_exclusive fail 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/3492 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 10/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/datapack-biomes-2` --- ### 📝 Commits (10+) - [`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 - [`0c63990`](https://github.com/horizon-rust/horizon/commit/0c639904f160ca8fec160a287e7aaa49156f65a9) Section sets past 32 sections: SectionMask replaces the u32 column masks - [`a849545`](https://github.com/horizon-rust/horizon/commit/a849545f63d0d91f4f7c51b8549f3206bc234149) Harness: chunks generated with a world's data packs against vanilla - [`46c62bd`](https://github.com/horizon-rust/horizon/commit/46c62bdf2a307b633d1ba6ea32b471ec0316c6d9) LevelShape: each level's shape as one value, and the column its chunks hold - [`a6d8409`](https://github.com/horizon-rust/horizon/commit/a6d8409466af6393be67ad2bf3a86b2fe8165906) Light reads the chunk's column: flood fill, layers and relighting span its sections - [`c2b5547`](https://github.com/horizon-rust/horizon/commit/c2b55479f119bb18bcd6fbbef33a1e23b8492086) World, streaming, meshing and the renderer read the level's column - [`fdb4e91`](https://github.com/horizon-rust/horizon/commit/fdb4e917c0be2d9f253883030e3df86a4490e0b6) Saves read and write a chunk's own column, and SaveDir takes its level's shape - [`9e91278`](https://github.com/horizon-rust/horizon/commit/9e912787941669987a711359429e2f0aee4d157c) Chunk packets map between the level and the client's column by the level's shape ### 📊 Changes **120 files changed** (+3598 additions, -754 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) 📝 `crates/horizon-client/examples/portal_scan_bench.rs` (+5 -7) 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+2 -2) 📝 `crates/horizon-client/src/arrows.rs` (+4 -4) 📝 `crates/horizon-client/src/biome.rs` (+233 -55) 📝 `crates/horizon-client/src/chunk.rs` (+356 -20) 📝 `crates/horizon-client/src/chunk_map.rs` (+3 -0) 📝 `crates/horizon-client/src/collisions.rs` (+1 -1) 📝 `crates/horizon-client/src/datapack.rs` (+131 -1) 📝 `crates/horizon-client/src/entities/fluids.rs` (+3 -3) 📝 `crates/horizon-client/src/flatgen.rs` (+16 -12) 📝 `crates/horizon-client/src/game.rs` (+66 -52) 📝 `crates/horizon-client/src/game/agent.rs` (+3 -2) 📝 `crates/horizon-client/src/game/beacon.rs` (+2 -2) 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+1 -1) 📝 `crates/horizon-client/src/game/chat.rs` (+1 -1) 📝 `crates/horizon-client/src/game/commands.rs` (+4 -6) 📝 `crates/horizon-client/src/game/commands/execute.rs` (+3 -3) 📝 `crates/horizon-client/src/game/commands/terrain_cmds.rs` (+3 -3) 📝 `crates/horizon-client/src/game/commands/world_cmds.rs` (+4 -4) _...and 80 more files_ </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3491 (`feat/datapack-biomes-1`)**: until that merges, its commits show here too; this PR's own change is the commit(s) on top. ## What and why Part 2 of 4 of data-pack biomes. - Opening a world builds its biome table from the built-in biomes and its enabled packs' biome files (`world_loading::set_world_biomes`, `Biomes::with_packs`). It sets the table on the shared `Resources`, now behind a lock (`Resources::set_biomes`; `biomes()` returns an `Arc`), before the generator decides which pack biomes to keep. So a pack's new biomes generate, colour, spawn and save by name, instead of being left out. - Streaming and distant terrain take a worker context with that table (`PackResources::context_with`), and `MobWorld` holds the table it reads (an `Arc`). - `worldgen::overrides` now leaves out only a pack biome whose file the game couldn't read. - `tools/fixtures/biome_datapacks/horizon_biome_test` (MIT): three new biomes, one under `minecraft:` and two in their own namespace, with their own colours, spawns, features and climate points in a multi-noise Overworld level stem. The chunk generation oracle uses a pack's `dimension/<id>.json` generator, as a world created with the pack does. A world without pack biomes gets the built-in table, as before. **Open PRs nearby:** #3300 edits nearby lines of `mob_ai_probe.rs`, and #3263 of `game.rs`. The overlap is in text only, not in what they do; whichever lands second needs a rebase. ## Vanilla reference None ## Self-check **Tests** `HORIZON_PARITY_DATAPACKS=tools/fixtures/biome_datapacks python3 tools/test_datapack_worldgen_parity.py` (8 min 35 s): ``` 12345-terrain: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0) 12345-terrain: without the packs Horizon differs from them in 4 of 4 chunks (713 blocks) 4242-terrain: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0) 4242-terrain: without the packs Horizon differs from them in 4 of 4 chunks (3461 blocks) 12345-full: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0) 12345-full: without the packs Horizon differs from them in 4 of 4 chunks (16554 blocks) 4242-full: 4 chunks with the packs, differing chunks 0 (blocks 0, biome cells 0, block entities 0) 4242-full: without the packs Horizon differs from them in 4 of 4 chunks (15166 blocks) Data pack worldgen parity passed ``` Plus the existing biome, data pack and mob tests. Run before this branch was rebased from upstream/main 56f968e11 onto fe3333f3f. After the rebase, CI's two clippy commands pass on it again, and pr_ready was re-run at the top of its series (#3494). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at 56f968e11, 15 min 29 s) | Check | Result | | --- | --- | | Scope | ⚠️ 121 files, +3590 −780; 3998 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 398 run, FAILED (failures=2, errors=8, skipped=1) (1 min 16 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 51 s) | | tests: horizon-client, horizon-protocol, horizon-world | ❌ 1107 passed, 2 failed (10 min 17 s) | | doc tests | ✅ 0 passed (1 min 48 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-biomes-1`) is 21 files, +319 −56, 361 lines of code. The Python tests fail on upstream main on this Windows machine too, more often there (main 56f968e11: failures=3, errors=13; path separators, symlink privilege). CI runs them on Linux. `crash::tests::stacks_start_at_the_panicking_frame` and `save::tests::session_lock_is_exclusive` fail 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:40 +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#5022
No description provided.