[PR #7528] [MERGED] Network: a world's data-pack biomes in the registry it sends, the client's table and the mesher #7647

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7528
Author: @ThatCakeIsAPie
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

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


📝 Commits (3)

  • 329eb2b Network: a world's data-pack biomes in the registry it sends, the client's table and the mesher
  • 364ce79 Biomes: single player keeps its pack biomes, mod colours stay in plain worlds, a new server's table replaces the last
  • a437093 Biomes: a packed world's mod colours start from the biome files each refresh, rebuilding only when they change

📊 Changes

11 files changed (+295 additions, -40 deletions)

View changed files

📝 crates/horizon-client-render/src/biome.rs (+19 -0)
📝 crates/horizon-client/Cargo.toml (+4 -0)
📝 crates/horizon-client/src/game.rs (+30 -6)
📝 crates/horizon-client/src/game/integrated.rs (+1 -0)
📝 crates/horizon-client/src/game/lan.rs (+14 -6)
📝 crates/horizon-client/src/game/native_biome_colors.rs (+19 -16)
📝 crates/horizon-client/src/game/packs.rs (+1 -1)
📝 crates/horizon-client/src/game/remote.rs (+28 -6)
📝 crates/horizon-client/src/game/world_loading.rs (+5 -5)
📝 crates/horizon-client/src/lan/data.rs (+53 -0)
➕ crates/horizon-client/tests/datapack_biome_sync.rs (+121 -0)

📄 Description

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

What and why

The multiplayer piece of closed #3493, rebuilt on #4577's per-world biome table (world_biomes!). Based on main; it doesn't need the fixture from #7393. Size: 11 files, +295 −40, about 174 added and 40 removed lines outside the test.

  • Meshing: in a world with its own table, chunk and far-terrain workers get that table (PackResources::context_with, Game::worker_context). Before this they used the game's built-in table, so a pack biome's id was clamped to the last vanilla biome and drew with the wrong grass, foliage and water colours. A plain world meshes as before, native mods' biome colours included. Resource-pack reloads keep the world's table, and in a packed world native_refresh_biome_colors colours from the table as the biome files made it (world_biomes_base, set wherever world_biomes is), so a season mod's tints don't go stale and a step-by-step mod's don't compound. It rebuilds meshing only when the result differs from the table in use (Biomes::recolored_from).
  • Single player: the window's own server thread keeps the world's table when it connects. join_server used to clear it, so single player never drew pack biomes.
  • LAN and dedicated server: when the world's packs add or replace biomes, lan_host sends that table as the biome registry (SyncData::load_with). A pack's biome goes with its JSON, even to clients that know the vanilla pack, so the chunk encoder gives it its real id instead of 0.
  • Joining a server: in set_registries, a Horizon client adds the server's biomes it doesn't have to its table (lan::data::client_biomes, using Biomes::with_packs on the data the server sent). Chunks, colours and meshing then name them instead of turning them into plains. A server, or a later reconfiguration, with no new biomes goes back to the game's table.

Not in this PR: a vanilla biome that a server's pack overrides still uses the client's own data when joining. Particles, music and ambient sounds for pack biomes (#3494) are also left out.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

RegistryDataLoader.SYNCHRONIZED_REGISTRIES / ClientboundRegistryDataPacket (a biome not in a known pack is sent with its data), RegistrySynchronization.packRegistries, ClientRegistryLayer on the client.

Other projects' code

none

Self-check

python3 tools/pr_ready.py --quick --base upstream/main against upstream/main 5914e52b9:

Check Result
Scope ✅ 11 files, +295 −40
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed
rustfmt ✅
clippy ✅
tests: horizon-client, horizon-client-lib, horizon-client-render ⚠️ 3304 passed, 9 failed: GPU tests in gfx:: (frame_gen, native_post, native_sky, pack_center_depth) that also fail on a clean tree here. The box's software adapter can't render to R32Float/Rgba32Float.
doc tests ✅
mod API up to date ✅
Parity ➖ not run (--quick)

New test crates/horizon-client/tests/datapack_biome_sync.rs uses a temp pack. It follows a pack biome from the server's biome registry, through the registry packet's entries, to the client's table (client_biomes), and checks that the client gives it the server's id and the pack's grass colour. It also checks that known biomes the server sends with different colours keep the game's colours, and that a registry of only known biomes gives no table. The test fails if the known-biome filter in client_biomes is removed. A second test checks that recolouring twice from the biome files gives no change, not compounded colours, and that a different colour function replaces the first. The single-player path needs a Game, which needs a window, so it has no test. Not tried in a running game: no GPU on this box, and no second client.

🤖 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/7528 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/datapack-biomes-network` --- ### 📝 Commits (3) - [`329eb2b`](https://github.com/horizon-rust/horizon/commit/329eb2bc1449cc041d4ee52fb9e438d8b297914e) Network: a world's data-pack biomes in the registry it sends, the client's table and the mesher - [`364ce79`](https://github.com/horizon-rust/horizon/commit/364ce79d153e1006060d1f77ab78b6f888f2906d) Biomes: single player keeps its pack biomes, mod colours stay in plain worlds, a new server's table replaces the last - [`a437093`](https://github.com/horizon-rust/horizon/commit/a43709317ed2b2a9c2fd531090bc50cb4c6e2e06) Biomes: a packed world's mod colours start from the biome files each refresh, rebuilding only when they change ### 📊 Changes **11 files changed** (+295 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/biome.rs` (+19 -0) 📝 `crates/horizon-client/Cargo.toml` (+4 -0) 📝 `crates/horizon-client/src/game.rs` (+30 -6) 📝 `crates/horizon-client/src/game/integrated.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+14 -6) 📝 `crates/horizon-client/src/game/native_biome_colors.rs` (+19 -16) 📝 `crates/horizon-client/src/game/packs.rs` (+1 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+28 -6) 📝 `crates/horizon-client/src/game/world_loading.rs` (+5 -5) 📝 `crates/horizon-client/src/lan/data.rs` (+53 -0) ➕ `crates/horizon-client/tests/datapack_biome_sync.rs` (+121 -0) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude Code, Claude Sonnet 5.5), not by ThatCakeIsAPie personally. ## What and why The multiplayer piece of closed #3493, rebuilt on #4577's per-world biome table (`world_biomes!`). Based on main; it doesn't need the fixture from #7393. Size: 11 files, +295 −40, about 174 added and 40 removed lines outside the test. - **Meshing:** in a world with its own table, chunk and far-terrain workers get that table (`PackResources::context_with`, `Game::worker_context`). Before this they used the game's built-in table, so a pack biome's id was clamped to the last vanilla biome and drew with the wrong grass, foliage and water colours. A plain world meshes as before, native mods' biome colours included. Resource-pack reloads keep the world's table, and in a packed world `native_refresh_biome_colors` colours from the table as the biome files made it (`world_biomes_base`, set wherever `world_biomes` is), so a season mod's tints don't go stale and a step-by-step mod's don't compound. It rebuilds meshing only when the result differs from the table in use (`Biomes::recolored_from`). - **Single player:** the window's own server thread keeps the world's table when it connects. `join_server` used to clear it, so single player never drew pack biomes. - **LAN and dedicated server:** when the world's packs add or replace biomes, `lan_host` sends that table as the biome registry (`SyncData::load_with`). A pack's biome goes with its JSON, even to clients that know the vanilla pack, so the chunk encoder gives it its real id instead of 0. - **Joining a server:** in `set_registries`, a Horizon client adds the server's biomes it doesn't have to its table (`lan::data::client_biomes`, using `Biomes::with_packs` on the data the server sent). Chunks, colours and meshing then name them instead of turning them into plains. A server, or a later reconfiguration, with no new biomes goes back to the game's table. Not in this PR: a vanilla biome that a server's pack overrides still uses the client's own data when joining. Particles, music and ambient sounds for pack biomes (#3494) are also left out. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `RegistryDataLoader.SYNCHRONIZED_REGISTRIES` / `ClientboundRegistryDataPacket` (a biome not in a known pack is sent with its data), `RegistrySynchronization.packRegistries`, `ClientRegistryLayer` on the client. ## Other projects' code none ## Self-check `python3 tools/pr_ready.py --quick --base upstream/main` against upstream/main 5914e52b9: | Check | Result | | --- | --- | | Scope | ✅ 11 files, +295 −40 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client, horizon-client-lib, horizon-client-render | ⚠️ 3304 passed, 9 failed: GPU tests in `gfx::` (frame_gen, native_post, native_sky, pack_center_depth) that also fail on a clean tree here. The box's software adapter can't render to R32Float/Rgba32Float. | | doc tests | ✅ | | mod API up to date | ✅ | | Parity | ➖ not run (--quick) | New test `crates/horizon-client/tests/datapack_biome_sync.rs` uses a temp pack. It follows a pack biome from the server's biome registry, through the registry packet's entries, to the client's table (`client_biomes`), and checks that the client gives it the server's id and the pack's grass colour. It also checks that known biomes the server sends with different colours keep the game's colours, and that a registry of only known biomes gives no table. The test fails if the known-biome filter in `client_biomes` is removed. A second test checks that recolouring twice from the biome files gives no change, not compounded colours, and that a different colour function replaces the first. The single-player path needs a `Game`, which needs a window, so it has no test. Not tried in a running game: no GPU on this box, and no second client. 🤖 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 07:21: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#7647
No description provided.