[PR #1510] [MERGED] Maps on a server's players: each holder's map ticks on the server and its data reaches them #3557

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1510
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/st-maps


📝 Commits (6)

  • c86996c Fishing on a server's players: a hook per player, ticked on the server and drawn by its clients
  • 287d7a7 Maps on a server's players: each holder's map ticks on the server and its data reaches them
  • 8c81cc6 Merge remote-tracking branch 'origin/fix/st-wind-charge' into fix/st-fishing
  • 26a91e3 Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps
  • 65031a7 Merge remote-tracking branch 'origin/main' into fix/st-fishing
  • 122e3bf Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps

📊 Changes

8 files changed (+704 additions, -91 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/control.rs (+1 -0)
📝 crates/horizon-client/src/game/fishing.rs (+241 -41)
📝 crates/horizon-client/src/game/lan.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+11 -0)
📝 crates/horizon-client/src/game/maps.rs (+321 -50)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+7 -0)
📝 tools/lan_e2e.py (+118 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #1382.

What

On a server (LAN guests, and single player on its server thread), a map a player makes now fills in while held and shows their marker. It is saved by the server.

Why

Checked against vanilla 26.3 first:

  • MapItem.inventoryTick runs on the server for each player: tickCarriedBy for every carried map (the markers) and update for the held one (the reveal).
  • MapItemSavedData.HoldingPlayer keeps, per player, the column sweep's step and the changed pixels' box.
  • ServerPlayer.synchronizeSpecialItemUpdates sends ClientboundMapItemDataPacket with the changed box. The decorations go at most every 5th tick while they changed.
  • ServerEntity.sendChanges does the same every 10 ticks for framed maps.

In Horizon only the game's own player ever ran tick_maps. The server thread has none, and in-frame that player is the host. The server also never sent map data, and a server's client ignored the packet's decorations. So a guest's map stayed blank: the issue's saved 0.dat had no pixels in threaded mode.

How

  • Guest ticks: each guest's turn in tick_guests now runs tick_maps as them: their carried maps' markers and their held map's reveal.
  • MapData::holders (HoldingPlayer): per player, the sweep step, the dirty box and the decoration flag. Changed pixels mark every holder (setColorsDirty). A changed decoration marks them all (setDecorationsDirty). Holders that no longer carry the map, or see it framed, are dropped with their markers.
  • Player markers are kept per holder and replaced in place. So two players carrying one map each show, and the drawing order stays put. The item's own decorations (explorer map targets) are rebuilt only when they change.
  • Packets (lan_map_updates): every tick, for each map a guest carries, and every 10 ticks for each map framed in the level, the guest gets the changed box. The decorations go every 5th tick while dirty, as MapDecorationType registry ids. DECORATION_TYPES maps the vanilla type names to Horizon's sprites in both directions.
  • Client (remote_map_item_data): applies the decorations too.
  • Harness: status.maps lists the carried maps, with their drawn pixel count and decorations.

Evidence

lan_e2e --check maps: each player makes a map from an empty map, holds it for 60 ticks, then reads status.maps.

in-frame host in-frame guest --server-thread host --server-thread guest
before fills (local) blank blank blank (maps-base2/guest-maps-held.png)
after 16384 px, player marker 16384 px, player marker 16384 px, player marker 16384 px, player marker

The "before" binaries have no status.maps, so they report no map at all. The screenshots are the evidence there: a blank map before, terrain, river and marker after.

cartography (a guest zooming a map) and frames still pass in both modes. The smoke session saves and reopens the world in both modes, and checks that the held map still has its pixels.

How tested

On the top of the stack (feat/st-default a4a101ca9, which contains this branch), on the Mac mini:

  • cargo fmt --all -- --check: clean.
  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib --bins: 1064 + 98 + 18 passed.
  • tools/parity.py --changed origin/main: 106/106 passed on the maps head, then 30/30 for the harnesses whose inputs changed after that.
  • tools/lan_e2e.py in the frame and with --server-thread: wind, fishing, maps, body, strikes and cursor pass in both. boats and minecarts pass with --server-thread.
  • A scripted single player session (walk, mine, place, inventory, combat, eating, boats, minecarts, chests, furnaces, beds, chat, signs, books, totems, keep_inventory, fishing, maps, then save and reopen): 48/48 on the server thread and 48/48 with --in-frame.

Stack

On top of the fishing PR (#1509). Merge order: … → #1476 → #1508 → #1509 → this.

Needs Ludovic

A review and a merge, in stack order.

🤖 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/1510 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/st-maps` --- ### 📝 Commits (6) - [`c86996c`](https://github.com/horizon-rust/horizon/commit/c86996c234457b08dafcae375a36ebdbe8fcadd9) Fishing on a server's players: a hook per player, ticked on the server and drawn by its clients - [`287d7a7`](https://github.com/horizon-rust/horizon/commit/287d7a7eb5e55a7936e89c9ac948f2a66aab74d1) Maps on a server's players: each holder's map ticks on the server and its data reaches them - [`8c81cc6`](https://github.com/horizon-rust/horizon/commit/8c81cc63f71f8f4c4c75a30f14406ed8cf3eaf88) Merge remote-tracking branch 'origin/fix/st-wind-charge' into fix/st-fishing - [`26a91e3`](https://github.com/horizon-rust/horizon/commit/26a91e3a08059af6f43af950593665774b58d1fe) Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps - [`65031a7`](https://github.com/horizon-rust/horizon/commit/65031a77397c2cc9cee24b2eb5e27d2db0ed36e6) Merge remote-tracking branch 'origin/main' into fix/st-fishing - [`122e3bf`](https://github.com/horizon-rust/horizon/commit/122e3bf2876bd05376ef6e699af07d95aa179165) Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps ### 📊 Changes **8 files changed** (+704 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/control.rs` (+1 -0) 📝 `crates/horizon-client/src/game/fishing.rs` (+241 -41) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+11 -0) 📝 `crates/horizon-client/src/game/maps.rs` (+321 -50) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+7 -0) 📝 `tools/lan_e2e.py` (+118 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1382. ## What On a server (LAN guests, and single player on its server thread), a map a player makes now fills in while held and shows their marker. It is saved by the server. ## Why Checked against vanilla 26.3 first: - **`MapItem.inventoryTick`** runs on the server for each player: `tickCarriedBy` for every carried map (the markers) and `update` for the held one (the reveal). - **`MapItemSavedData.HoldingPlayer`** keeps, per player, the column sweep's step and the changed pixels' box. - **`ServerPlayer.synchronizeSpecialItemUpdates`** sends `ClientboundMapItemDataPacket` with the changed box. The decorations go at most every 5th tick while they changed. - **`ServerEntity.sendChanges`** does the same every 10 ticks for framed maps. In Horizon only the game's own player ever ran `tick_maps`. The server thread has none, and in-frame that player is the host. The server also never sent map data, and a server's client ignored the packet's decorations. So a guest's map stayed blank: the issue's saved `0.dat` had no pixels in threaded mode. ## How - **Guest ticks:** each guest's turn in `tick_guests` now runs `tick_maps` as them: their carried maps' markers and their held map's reveal. - **`MapData::holders`** (`HoldingPlayer`): per player, the sweep step, the dirty box and the decoration flag. Changed pixels mark every holder (`setColorsDirty`). A changed decoration marks them all (`setDecorationsDirty`). Holders that no longer carry the map, or see it framed, are dropped with their markers. - **Player markers** are kept per holder and replaced in place. So two players carrying one map each show, and the drawing order stays put. The item's own decorations (explorer map targets) are rebuilt only when they change. - **Packets** (`lan_map_updates`): every tick, for each map a guest carries, and every 10 ticks for each map framed in the level, the guest gets the changed box. The decorations go every 5th tick while dirty, as `MapDecorationType` registry ids. `DECORATION_TYPES` maps the vanilla type names to Horizon's sprites in both directions. - **Client** (`remote_map_item_data`): applies the decorations too. - **Harness:** `status.maps` lists the carried maps, with their drawn pixel count and decorations. ## Evidence `lan_e2e --check maps`: each player makes a map from an empty map, holds it for 60 ticks, then reads `status.maps`. | | in-frame host | in-frame guest | `--server-thread` host | `--server-thread` guest | |---|---|---|---|---| | **before** | fills (local) | **blank** | **blank** | **blank** (`maps-base2/guest-maps-held.png`) | | **after** | 16384 px, player marker | 16384 px, player marker | 16384 px, player marker | 16384 px, player marker | The "before" binaries have no `status.maps`, so they report no map at all. The screenshots are the evidence there: a blank map before, terrain, river and marker after. `cartography` (a guest zooming a map) and `frames` still pass in both modes. The smoke session saves and reopens the world in both modes, and checks that the held map still has its pixels. ## How tested On the top of the stack (`feat/st-default` a4a101ca9, which contains this branch), on the Mac mini: - `cargo fmt --all -- --check`: clean. - `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib --bins`: 1064 + 98 + 18 passed. - `tools/parity.py --changed origin/main`: 106/106 passed on the maps head, then 30/30 for the harnesses whose inputs changed after that. - `tools/lan_e2e.py` in the frame and with `--server-thread`: `wind`, `fishing`, `maps`, `body`, `strikes` and `cursor` pass in both. `boats` and `minecarts` pass with `--server-thread`. - A scripted single player session (walk, mine, place, inventory, combat, eating, boats, minecarts, chests, furnaces, beds, chat, signs, books, totems, keep_inventory, fishing, maps, then save and reopen): 48/48 on the server thread and 48/48 with `--in-frame`. ## Stack On top of the fishing PR (#1509). Merge order: … → #1476 → #1508 → #1509 → **this**. ## Needs Ludovic A review and a merge, in stack order. 🤖 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 04:10:24 +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#3557
No description provided.