[PR #1213] [MERGED] Server players respawn at their point in the Nether (anchors, spawnpoint) #3426

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

📋 Pull Request Information

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

Base: main ← Head: fix/server-respawn-levels


📝 Commits (10+)

  • bd36508 lan_e2e levels: players in their own levels on the server thread; design note
  • 84171cf lan_e2e portals: wait for the guest to be placed in its Nether portal
  • 9fe228c Server commands run in their source's level (execute in, execute at)
  • 86fdc72 Server players go through End gateways
  • 2ced9a4 Server players respawn at their point in the Nether (anchors, spawnpoint)
  • b6b6eb9 Merge origin/main into feat/lan-levels-check
  • 5a2d55c Merge the updated stack base (with origin/main) into fix/server-command-levels
  • 54e9379 Merge the updated stack base (with origin/main) into fix/server-end-gateways
  • 65fbde0 Merge the updated stack base (with origin/main) into fix/server-respawn-levels
  • 5e55ebd Merge origin/main into feat/lan-levels-check

📊 Changes

14 files changed (+704 additions, -70 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+6 -13)
📝 crates/horizon-client/src/game/commands.rs (+35 -20)
📝 crates/horizon-client/src/game/commands/execute.rs (+11 -3)
📝 crates/horizon-client/src/game/end.rs (+17 -9)
📝 crates/horizon-client/src/game/lan_actions.rs (+32 -11)
📝 crates/horizon-client/src/game/levels.rs (+18 -0)
📝 crates/horizon-client/src/game/respawn_anchor.rs (+38 -3)
📝 crates/horizon-client/src/game/server_travel.rs (+129 -3)
📝 crates/horizon-client/src/lan/guest.rs (+5 -0)
📝 crates/horizon-client/src/lan/hub.rs (+18 -3)
📝 crates/horizon-client/src/lan/playerdata.rs (+2 -0)
➕ docs/server-levels.md (+93 -0)
📝 docs/server.md (+1 -1)
📝 tools/lan_e2e.py (+299 -4)

📄 Description

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

Brief lan-levels-1, part 4 of 4. Stacked on #1212.

What

A server's player always respawned in the Overworld. That covers a LAN guest and, since #1114, the single player too, who is the server thread's player. Two things were lost:

  • Respawn anchors. The anchor a player used was dropped when its action ended (enter_guest took the respawn config and never gave it back).
  • Saved points outside the Overworld. The player's save kept only an Overworld point.

Changes:

  • A guest keeps a respawn point outside the Overworld (Guest::respawn_elsewhere), saved as the player's respawn. It has that point in place while it acts, so an anchor it uses is its own.
  • guest_respawn respawns the player in that point's level and waits there for the chunks. Then it resolves the point through its block (findRespawnAndUseSpawnBlock): beside the anchor, using a charge, with the deplete sound. If the block is gone, the player goes to the world spawn with block.minecraft.spawn.not_valid, as the in-frame game does (place_respawned).
  • spawnpoint run in a level other than the Overworld now sets a forced point there (SetSpawnCommand). Before, it set Overworld coordinates. A forced point that is not an anchor holds where a player fits (isPossibleToRespawnInThis). This applies in the window's own game too.
  • RespawnConfig::from_saved and saved replace the two copies of the conversion in game.rs.

Test

lan_e2e levels, step respawn_points: in the Nether, the guest sets a spawnpoint and dies, then uses a charged anchor and dies again.

  • Before this PR, it respawned in the Overworld both times.
  • With this PR, it respawns at both points in the Nether, and the anchor goes from 2 charges to 1.

How tested (Mac mini)

On the stack's tip (#1213), whose test code is a superset of this one, rebased on main b88218d0:

  • cargo fmt --check: OK. cargo clippy --workspace --all-targets -- -D warnings: OK, and on each branch of the stack. cargo test -p horizon-client: 995 + 91 + 22 passed.
  • lan_e2e --server-thread --check portals --check levels --check tab: 3/3, all 8 levels steps pass. In the frame, levels is skipped.

Earlier, on the same code built on #1114:

  • Full lan_e2e --server-thread: 46/50. swings is the known race (#1114). portals failed once: the check read the guest's Nether position before the guest had been placed in its portal. #1210 now waits for that (it happened again once after the first rebase, then passed 2/2 with the wait). flight and levels failed after it, because the guest was left in the Nether. All four pass on rerun.
  • Full in-frame lan_e2e: 45/50. The guest died before swings, and swings, cracks, plates, effects and flight failed after it, on the dead screen. All 5 pass on rerun. The in-frame suite's flakes on this busy machine are in #1114 too.
  • Parity: server_dimension_players, command_exec, nether_portal, anchor, end_gateway and end_podium pass. dedicated_server failed 3 times on play-pearl teleported 0 time(s), then passed 3/3. It fails the same way on the base (#1114's head): 1 of 2. It is the known pearl flake. Changed set (--changed, 83 harnesses, same Rust code before the rebase onto main): 82 pass. world_spawn was cut off twice (a restart of the agent's server, then a time limit on the rerun on the tip) after 60/60 origins and 58 spawn seeds, all matching vanilla.
  • No perf rerun. With nobody outside the Overworld, the server tick runs the same single pass. The new code runs only for commands whose source is in another level, players touching a gateway, and respawns. The Mac mini was 90% busy, which makes the bench unreliable (#1114).

Cost of an extra level (docs/server-levels.md): 1.0 ms a tick with both players in the Overworld, 2.2 ms with the guest in the Nether, about +45 MB.

Needs Ludovic

Nothing. Left for later (docs/server-levels.md): end credits for server players (#338), entities through portals between levels, and @e across every level.

🤖 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/1213 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-respawn-levels` --- ### 📝 Commits (10+) - [`bd36508`](https://github.com/horizon-rust/horizon/commit/bd36508c298cfee286986088a1b30ecdac68d34b) lan_e2e levels: players in their own levels on the server thread; design note - [`84171cf`](https://github.com/horizon-rust/horizon/commit/84171cfc94c048807520c426cf9a4af05aaf289f) lan_e2e portals: wait for the guest to be placed in its Nether portal - [`9fe228c`](https://github.com/horizon-rust/horizon/commit/9fe228cd1e2753e252f40a2f49150779316423cf) Server commands run in their source's level (execute in, execute at) - [`86fdc72`](https://github.com/horizon-rust/horizon/commit/86fdc720696f99f591b8f1519aedbab56340577d) Server players go through End gateways - [`2ced9a4`](https://github.com/horizon-rust/horizon/commit/2ced9a451dcb900d73719308e86d740fd923306f) Server players respawn at their point in the Nether (anchors, spawnpoint) - [`b6b6eb9`](https://github.com/horizon-rust/horizon/commit/b6b6eb9a87b97f75c03be38bd5edefa803d110cf) Merge origin/main into feat/lan-levels-check - [`5a2d55c`](https://github.com/horizon-rust/horizon/commit/5a2d55c8639f852294e90303c80ac00d748f442b) Merge the updated stack base (with origin/main) into fix/server-command-levels - [`54e9379`](https://github.com/horizon-rust/horizon/commit/54e9379bc1ba3851f6efb7d9a4590529e49f7502) Merge the updated stack base (with origin/main) into fix/server-end-gateways - [`65fbde0`](https://github.com/horizon-rust/horizon/commit/65fbde0f15bb232d20da32999764dd25fc291cd3) Merge the updated stack base (with origin/main) into fix/server-respawn-levels - [`5e55ebd`](https://github.com/horizon-rust/horizon/commit/5e55ebd2a76ebe8fb69e1a8c6a216b1c8ce8a1d6) Merge origin/main into feat/lan-levels-check ### 📊 Changes **14 files changed** (+704 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+6 -13) 📝 `crates/horizon-client/src/game/commands.rs` (+35 -20) 📝 `crates/horizon-client/src/game/commands/execute.rs` (+11 -3) 📝 `crates/horizon-client/src/game/end.rs` (+17 -9) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+32 -11) 📝 `crates/horizon-client/src/game/levels.rs` (+18 -0) 📝 `crates/horizon-client/src/game/respawn_anchor.rs` (+38 -3) 📝 `crates/horizon-client/src/game/server_travel.rs` (+129 -3) 📝 `crates/horizon-client/src/lan/guest.rs` (+5 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+18 -3) 📝 `crates/horizon-client/src/lan/playerdata.rs` (+2 -0) ➕ `docs/server-levels.md` (+93 -0) 📝 `docs/server.md` (+1 -1) 📝 `tools/lan_e2e.py` (+299 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Brief lan-levels-1, part 4 of 4. **Stacked on #1212.** ## What A server's player always respawned in the Overworld. That covers a LAN guest and, since #1114, the single player too, who is the server thread's player. Two things were lost: - **Respawn anchors.** The anchor a player used was dropped when its action ended (`enter_guest` took the respawn config and never gave it back). - **Saved points outside the Overworld.** The player's save kept only an Overworld point. Changes: - A guest keeps a respawn point outside the Overworld (`Guest::respawn_elsewhere`), saved as the player's `respawn`. It has that point in place while it acts, so an anchor it uses is its own. - `guest_respawn` respawns the player in that point's level and waits there for the chunks. Then it resolves the point through its block (`findRespawnAndUseSpawnBlock`): beside the anchor, using a charge, with the deplete sound. If the block is gone, the player goes to the world spawn with `block.minecraft.spawn.not_valid`, as the in-frame game does (`place_respawned`). - `spawnpoint` run in a level other than the Overworld now sets a forced point there (`SetSpawnCommand`). Before, it set Overworld coordinates. A forced point that is not an anchor holds where a player fits (`isPossibleToRespawnInThis`). This applies in the window's own game too. - `RespawnConfig::from_saved` and `saved` replace the two copies of the conversion in game.rs. ## Test `lan_e2e levels`, step `respawn_points`: in the Nether, the guest sets a `spawnpoint` and dies, then uses a charged anchor and dies again. - Before this PR, it respawned in the Overworld both times. - With this PR, it respawns at both points in the Nether, and the anchor goes from 2 charges to 1. ## How tested (Mac mini) On the stack's tip (#1213), whose test code is a superset of this one, rebased on `main` b88218d0: - `cargo fmt --check`: OK. `cargo clippy --workspace --all-targets -- -D warnings`: OK, and on each branch of the stack. `cargo test -p horizon-client`: 995 + 91 + 22 passed. - `lan_e2e --server-thread --check portals --check levels --check tab`: 3/3, all 8 `levels` steps pass. In the frame, `levels` is skipped. Earlier, on the same code built on #1114: - Full `lan_e2e --server-thread`: 46/50. `swings` is the known race (#1114). `portals` failed once: the check read the guest's Nether position before the guest had been placed in its portal. #1210 now waits for that (it happened again once after the first rebase, then passed 2/2 with the wait). `flight` and `levels` failed after it, because the guest was left in the Nether. All four pass on rerun. - Full in-frame `lan_e2e`: 45/50. The guest died before `swings`, and `swings`, `cracks`, `plates`, `effects` and `flight` failed after it, on the dead screen. All 5 pass on rerun. The in-frame suite's flakes on this busy machine are in #1114 too. - Parity: `server_dimension_players`, `command_exec`, `nether_portal`, `anchor`, `end_gateway` and `end_podium` pass. `dedicated_server` failed 3 times on `play-pearl teleported 0 time(s)`, then passed 3/3. It fails the same way on the base (#1114's head): 1 of 2. It is the known pearl flake. Changed set (`--changed`, 83 harnesses, same Rust code before the rebase onto `main`): 82 pass. `world_spawn` was cut off twice (a restart of the agent's server, then a time limit on the rerun on the tip) after 60/60 origins and 58 spawn seeds, all matching vanilla. - No perf rerun. With nobody outside the Overworld, the server tick runs the same single pass. The new code runs only for commands whose source is in another level, players touching a gateway, and respawns. The Mac mini was 90% busy, which makes the bench unreliable (#1114). Cost of an extra level (docs/server-levels.md): 1.0 ms a tick with both players in the Overworld, 2.2 ms with the guest in the Nether, about +45 MB. ## Needs Ludovic Nothing. Left for later (docs/server-levels.md): end credits for server players (#338), entities through portals between levels, and `@e` across every level. 🤖 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:09:27 +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#3426
No description provided.