[PR #6324] [MERGED] Far terrain on servers without horizon:lod (2/5): BlueMap's lowres tiles, settings and palette #6796

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6324
Author: @some-du6e
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: far-terrain/2a-bluemap-format


📝 Commits (2)

  • 76d4f70 BlueMap's lowres tiles, settings and palette, for far terrain
  • b133ad2 Merge main into #6324

📊 Changes

4 files changed (+881 additions, -13 deletions)

View changed files

📝 THIRD_PARTY_NOTICES.md (+32 -0)
➕ crates/horizon-client-render/src/bluemap.rs (+835 -0)
📝 crates/horizon-client-render/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/client_lib.rs (+13 -13)

📄 Description

Splits the BlueMap part of this stack in two, so it can be reviewed. The problem it solves is in PR 1: servers without horizon:lod have no far terrain past what the player has seen. Many servers run a BlueMap web map that covers the whole world. This PR is the half that knows BlueMap's formats. Nothing here is wired up yet.

This PR: 76d4f7058

bluemap.rs, first half:

  • Settings. The formats of the player's settings: blueMap: lines in their own file, horizon-bluemap.txt, and blueMapRadius: (the next PR wires them into horizon-graphics.txt and loads the file). The map lines are kept out of the graphics settings because shared instances and modpacks carry that file, and only the player should name a map that is sent their position.
  • The map's own settings. The web app's settings.json and a map's lowres layout (tileSize, lodFactor, lodCount). These are validated, so a hostile map can't overflow block coordinates or index past a tile.
  • Locating pixels. Where a block's pixel is at every level (LowresLayer.saveTile), and the tile paths (pathFromCoords).
  • Decoding. A lowres tile's PNG: colour, height clamped to the world's reach, and block light. Gzipped tiles are read too.
  • Palette. A colour becomes the natural block nearest it, tinted by its biome the way the game draws it.

Tests: tile decoding, paths, pixel positions at every level, settings parsing and round-trips (map lines read only from their own file), and colours to blocks.

The stack

This follows #4945–#4947, Ludovic's horizon:lod stack, which is now merged. That stack covers Horizon servers that sample far terrain for their clients. This one covers every other server: vanilla, Paper and Spigot never send their seed, so far terrain had nothing to draw there. prepare_lod tries the integrated server first, then the server's horizon:lod offer, and only falls back to this stack when there is no offer. Status reports this fallback as lod.source: "server-terrain", so the two can be told apart.

Each PR targets main and holds the PRs before it, so review only the commits listed under "This PR". Merge them in order.

  1. #6323: keep the chunks a server sent
  2. #6324 (this one): BlueMap's lowres tiles, settings and palette
  3. #6325: draw the rest from the server's BlueMap
  4. #6326: Find BlueMap, and no re-mesh storms
  5. #6327: no rings of nothing, slabs or holes
  6. #6643: read Bobby's cache too, written from its files on disk

Other projects' code

  • BlueMap, BlueMap at 96ae320d1d39, MIT (each file's header says so too). bluemap.rs follows three of its files: LowresLayer.java (saveTile) for the tiles' pixel layout, the web app's Utils.js (pathFromCoords) for their paths, and MapSettingsSerializer.java for a map's settings.json. Credited in THIRD_PARTY_NOTICES.md (with the MIT text) and at the top of bluemap.rs.
  • MapLink was named in an earlier version of this stack, as a comparison ("as the MapLink mod does"). The mod on Modrinth by that name is GPL-3.0, so the mention is gone. bluemap.rs cites only BlueMap's MIT files, above.

Checked

  • CI on the fork (run): clippy --all-targets -D warnings on horizon-client-render, horizon-client and horizon-mods and the render crate's tests at every one of the 9 commits, and cargo fmt --check, the horizon-client tests and horizon-mods' modpack tests on the top one.

  • Live test on GitHub Actions (run). The runner downloads the pinned 26.3 from Mojang (every file checked against Mojang's SHA-1) and runs horizon-prepare. Then:

    • It records a local world drawing a real server's BlueMap as far terrain (video, recorded on these exact commits).

    Far terrain from a server's BlueMap

    • It runs tools/server_lod_e2e.py against a real dedicated server. With horizon-lod-distance set it reports source: server. Without it, it reports source: server-terrain (updated in PR 1).
  • Review: 16 rounds of independent reviewers, the last with no real findings (correctness, edge cases, tests, simplicity, fit) over the whole stack. Each finding went into the commit it belongs to. Since then, the .bobby reader came out and the stack was rebased on main; CI above is on the result.

  • Not run: the parity harnesses, and pr_ready.py (it needs .local/, which this machine doesn't build).

Suggested labels, since this fork can't set them: feature and needs-proof.

Note

Filed by Opus 5.5 using 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/6324 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `far-terrain/2a-bluemap-format` --- ### 📝 Commits (2) - [`76d4f70`](https://github.com/horizon-rust/horizon/commit/76d4f7058abe84a550144a434a307b81c3865938) BlueMap's lowres tiles, settings and palette, for far terrain - [`b133ad2`](https://github.com/horizon-rust/horizon/commit/b133ad22cdc2aedee54cfea97911f3fd537f26d9) Merge main into #6324 ### 📊 Changes **4 files changed** (+881 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `THIRD_PARTY_NOTICES.md` (+32 -0) ➕ `crates/horizon-client-render/src/bluemap.rs` (+835 -0) 📝 `crates/horizon-client-render/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/client_lib.rs` (+13 -13) </details> ### 📄 Description Splits the BlueMap part of this stack in two, so it can be reviewed. The problem it solves is in PR 1: servers without `horizon:lod` have no far terrain past what the player has seen. Many servers run a [BlueMap](https://bluemap.bluecolored.de/) web map that covers the whole world. This PR is the half that knows BlueMap's formats. Nothing here is wired up yet. ## This PR: `76d4f7058` `bluemap.rs`, first half: - **Settings.** The formats of the player's settings: `blueMap:` lines in their own file, `horizon-bluemap.txt`, and `blueMapRadius:` (the next PR wires them into `horizon-graphics.txt` and loads the file). The map lines are kept out of the graphics settings because shared instances and modpacks carry that file, and only the player should name a map that is sent their position. - **The map's own settings.** The web app's `settings.json` and a map's lowres layout (`tileSize`, `lodFactor`, `lodCount`). These are validated, so a hostile map can't overflow block coordinates or index past a tile. - **Locating pixels.** Where a block's pixel is at every level (`LowresLayer.saveTile`), and the tile paths (`pathFromCoords`). - **Decoding.** A lowres tile's PNG: colour, height clamped to the world's reach, and block light. Gzipped tiles are read too. - **Palette.** A colour becomes the natural block nearest it, tinted by its biome the way the game draws it. Tests: tile decoding, paths, pixel positions at every level, settings parsing and round-trips (map lines read only from their own file), and colours to blocks. ## The stack This follows #4945–#4947, Ludovic's `horizon:lod` stack, which is now merged. That stack covers Horizon servers that sample far terrain for their clients. This one covers every other server: vanilla, Paper and Spigot never send their seed, so far terrain had nothing to draw there. `prepare_lod` tries the integrated server first, then the server's `horizon:lod` offer, and only falls back to this stack when there is no offer. Status reports this fallback as `lod.source: "server-terrain"`, so the two can be told apart. Each PR targets `main` and holds the PRs before it, so review only the commits listed under "This PR". Merge them in order. 1. #6323: keep the chunks a server sent 2. **#6324 (this one)**: BlueMap's lowres tiles, settings and palette 3. #6325: draw the rest from the server's BlueMap 4. #6326: Find BlueMap, and no re-mesh storms 5. #6327: no rings of nothing, slabs or holes 6. #6643: read Bobby's cache too, written from its files on disk ## Other projects' code - **BlueMap**, [BlueMap](https://github.com/BlueMap-Minecraft/BlueMap) at [`96ae320d1d39`](https://github.com/BlueMap-Minecraft/BlueMap/tree/96ae320d1d39581c10058d8222f2290f2fcb5333), MIT (each file's header says so too). `bluemap.rs` follows three of its files: `LowresLayer.java` (`saveTile`) for the tiles' pixel layout, the web app's `Utils.js` (`pathFromCoords`) for their paths, and `MapSettingsSerializer.java` for a map's `settings.json`. Credited in `THIRD_PARTY_NOTICES.md` (with the MIT text) and at the top of `bluemap.rs`. - **MapLink** was named in an earlier version of this stack, as a comparison ("as the MapLink mod does"). The mod on Modrinth by that name is GPL-3.0, so the mention is gone. `bluemap.rs` cites only BlueMap's MIT files, above. ## Checked - **CI on the fork** ([run](https://github.com/some-du6e/horizon/actions/runs/41362609329)): `clippy --all-targets -D warnings` on `horizon-client-render`, `horizon-client` and `horizon-mods` and the render crate's tests at every one of the 9 commits, and `cargo fmt --check`, the `horizon-client` tests and `horizon-mods`' modpack tests on the top one. - **Live test on GitHub Actions** ([run](https://github.com/some-du6e/horizon/actions/runs/41363312105)). The runner downloads the pinned 26.3 from Mojang (every file checked against Mojang's SHA-1) and runs `horizon-prepare`. Then: - It records a local world drawing a real server's BlueMap as far terrain ([video](https://github.com/some-du6e/horizon/releases/download/far-terrain-video/far-terrain-bluemap.mp4), recorded on these exact commits). [![Far terrain from a server's BlueMap](https://github.com/some-du6e/horizon/releases/download/far-terrain-video/far-terrain-bluemap.png)](https://github.com/some-du6e/horizon/releases/download/far-terrain-video/far-terrain-bluemap.mp4) - It runs `tools/server_lod_e2e.py` against a real dedicated server. With `horizon-lod-distance` set it reports `source: server`. Without it, it reports `source: server-terrain` (updated in PR 1). - **Review:** 16 rounds of independent reviewers, the last with no real findings (correctness, edge cases, tests, simplicity, fit) over the whole stack. Each finding went into the commit it belongs to. Since then, the `.bobby` reader came out and the stack was rebased on `main`; CI above is on the result. - **Not run:** the parity harnesses, and `pr_ready.py` (it needs `.local/`, which this machine doesn't build). Suggested labels, since this fork can't set them: `feature` and `needs-proof`. > [!NOTE] > Filed by Opus 5.5 using 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:26:48 +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#6796
No description provided.