[PR #624] [MERGED] Respawn on a server in vanilla's order (vanilla clients no longer stuck loading) #2676

Closed
opened 2026-11-02 15:58:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/respawn-level-load


📝 Commits (1)

  • 66d187e Respawn on a server in vanilla's order, so vanilla clients leave the loading screen

📊 Changes

5 files changed (+250 additions, -34 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+28 -5)
📝 crates/horizon-client/src/lan/guest.rs (+3 -0)
📝 crates/horizon-client/src/lan/hub.rs (+76 -20)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java (+107 -5)
📝 tools/test_dedicated_server_parity.py (+36 -4)

📄 Description

Fixes #566

What

A vanilla 26.3 client that died on a Horizon server stayed on the loading screen after Respawn. ClientPacketListener.handleRespawn starts a LevelLoadTracker that waits for the level info's "level chunks load start" game event (13) and the chunk under the player; Horizon's respawn sent neither the level info nor the chunk cache centre.

Hub::respawn now follows PlayerList.respawn packet for packet:

  • entities paired with the dead player removed (one RemoveEntities each, ServerEntity.removePairing); its chunks dropped without ForgetLevelChunk (PlayerChunkSender.dropChunk skips dead players) and sent again;
  • abilities (restoreFrom), Respawn with the last death location, teleport to the spawn facing its direction, default spawn, difficulty, experience, post effects, level info (border, time, spawn, game event 13, ticking state/step), permission level, chunk cache centre, inventory.
  • a dying guest gets the death animation entity event (3) and no health update while dead (ServerPlayer.die).

Also fixed on the way (the harness needed it): guests' commands ran at the host's permission level, so an operator on a dedicated server couldn't run operator commands (and LAN guests ran the host's level instead of vanilla's GAMEMASTER). They now run at the guest's own level, matching the command tree they are sent.

Harness

tools/test_dedicated_server_parity.py (+ VanillaProtocolClient): after trading, the console ops the player, the vanilla-codec client runs /kill, respawns, and the packets from the death screen to the respawned inventory are compared with vanilla's server (chat, chunk data, light, keep-alives, entity movement and the dead player's health left out; runs counted), then the level must load where it respawned. The client now sends the teleport acceptance alone during the respawn, as the 26.3 client does (vanilla kicks a second position packet in the same tick). Guests' death messages are not Horizon's yet ("<name> died"), so the death text and its console line are left out of the comparison (follow-up).

Result: dedicated server: 565 transcript lines identical (before the hub change the Horizon side never sent game event 13: level never loaded).

Checks

  • cargo fmt --all --check, cargo clippy -p horizon-client --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib: run on the integration commit of this batch (see comment)
  • tools/parity.py --changed origin/main (84 harnesses): run once on the integration commit of this batch (#566, #543, #500), results in a comment

🤖 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/624 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/respawn-level-load` --- ### 📝 Commits (1) - [`66d187e`](https://github.com/horizon-rust/horizon/commit/66d187ed06e904a2937ef6da51189f8193fc6d37) Respawn on a server in vanilla's order, so vanilla clients leave the loading screen ### 📊 Changes **5 files changed** (+250 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+28 -5) 📝 `crates/horizon-client/src/lan/guest.rs` (+3 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+76 -20) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java` (+107 -5) 📝 `tools/test_dedicated_server_parity.py` (+36 -4) </details> ### 📄 Description Fixes #566 ## What A vanilla 26.3 client that died on a Horizon server stayed on the loading screen after Respawn. `ClientPacketListener.handleRespawn` starts a `LevelLoadTracker` that waits for the level info's **"level chunks load start"** game event (13) and the chunk under the player; Horizon's respawn sent neither the level info nor the chunk cache centre. `Hub::respawn` now follows `PlayerList.respawn` packet for packet: - entities paired with the dead player removed (one `RemoveEntities` each, `ServerEntity.removePairing`); its chunks dropped **without** `ForgetLevelChunk` (`PlayerChunkSender.dropChunk` skips dead players) and sent again; - abilities (`restoreFrom`), `Respawn` with the **last death location**, teleport to the spawn facing its direction, default spawn, difficulty, experience, post effects, **level info** (border, time, spawn, game event 13, ticking state/step), permission level, **chunk cache centre**, inventory. - a dying guest gets the death animation entity event (3) and no health update while dead (`ServerPlayer.die`). Also fixed on the way (the harness needed it): **guests' commands ran at the host's permission level**, so an operator on a dedicated server couldn't run operator commands (and LAN guests ran the host's level instead of vanilla's GAMEMASTER). They now run at the guest's own level, matching the command tree they are sent. ## Harness `tools/test_dedicated_server_parity.py` (+ `VanillaProtocolClient`): after trading, the console ops the player, the vanilla-codec client runs `/kill`, respawns, and the packets from the death screen to the respawned inventory are compared with vanilla's server (chat, chunk data, light, keep-alives, entity movement and the dead player's health left out; runs counted), then the level must load where it respawned. The client now sends the teleport acceptance alone during the respawn, as the 26.3 client does (vanilla kicks a second position packet in the same tick). Guests' death messages are not Horizon's yet (`"<name> died"`), so the death text and its console line are left out of the comparison (follow-up). Result: `dedicated server: 565 transcript lines identical` (before the hub change the Horizon side never sent game event 13: `level never loaded`). ## Checks - `cargo fmt --all --check`, `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib`: run on the integration commit of this batch (see comment) - `tools/parity.py --changed origin/main` (84 harnesses): run once on the integration commit of this batch (#566, #543, #500), results in a comment 🤖 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-02 15:58:10 +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#2676
No description provided.