[PR #1724] [MERGED] Fix spectator collision after dimension travel #3718

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

📋 Pull Request Information

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

Base: main ← Head: t3/19c12e83


📝 Commits (2)

  • 6e86e07 Multiplayer: keep spectator collision state after dimension travel
  • b1eae8a Tests: keep spectator regression separate from new LAN checks

📊 Changes

2 files changed (+53 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+2 -0)
📝 tools/lan_e2e.py (+51 -0)

📄 Description

🤖 Opened by rdbt's AI agent (OpenCode, agentrouter/gpt-6.1-sol).

What and why

Fixes #1299.

Dimension entry applies the game mode to the old player and then removes that body. The replacement created in remote_teleport receives the server's cached flight abilities, but its spectator collision flag remained at its default false.

  • Initialize the replacement body's spectator flag from the current game mode.
  • Add the spectator-travel LAN end-to-end check: enter the Nether and return to the Overworld while remaining a spectator, fly through a verified stone wall in each dimension, and check both client and authoritative positions. It covers the integrated-server host, LAN guest, and in-frame host.

The gameplay fix is two added lines; the regression is 51 lines.

Vanilla reference

Read the pinned Minecraft 26.3 bytecode with tools/rea_vanilla.py:

  • net.minecraft.world.entity.player.Player.tick: sets noPhysics = isSpectator() before movement.
  • net.minecraft.client.multiplayer.ClientPacketListener.handleRespawn: creates the replacement LocalPlayer, installs it, and retains/applies the spawn's game mode.

Gameplay regression: tools/lan_e2e.py --check spectator-travel, also with --server-thread.

Regression verification

Ran the checked-in LAN harness through a local Xvfb adapter, using the freshly built target/fast binaries and prepared 26.3 resources from the main checkout. All game data and settings were isolated in temporary folders.

Before the fix, the server-thread host remained in spectator mode with flight enabled but stopped at Z=2.70 on both the client and server, against the wall at Z=3. The new regression failed on that collision.

After the fix:

Player/path Nether client/server Z Overworld client/server Z
Server-thread host 12.48 / 12.74 11.45 / 11.59
LAN guest 13.43 / 13.43 10.93 / 11.07
In-frame host 14.97 / 15.26 10.93 / 11.07

Every case retained spectator flight and passed the stone wall in both views without cycling game mode. The regression also captures before/after screenshots for each traversal.

Self-check

pr_ready (tools/pr_ready.py on archlinux, against origin/main at 947d65e64, 3 min 43 s)

Check Result
Scope ✅ 2 files, +53 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 252 passed (2 min 7 s)
rustfmt ✅ (39 s)
clippy ✅ (3 s)
tests: horizon-client ✅ 1200 passed (46 s)
doc tests ✅ 0 passed (7 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The worktree has no prepared .local/ for the parity runner; the vanilla parity suite remains for the maintainer/CI run.

🤖 Generated with OpenCode (agentrouter/gpt-6.1-sol).


🔄 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/1724 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/19c12e83` --- ### 📝 Commits (2) - [`6e86e07`](https://github.com/horizon-rust/horizon/commit/6e86e0778149a0510c944e880b80301d2bee3753) Multiplayer: keep spectator collision state after dimension travel - [`b1eae8a`](https://github.com/horizon-rust/horizon/commit/b1eae8a5b87979425bc7a07af9f25fc257286581) Tests: keep spectator regression separate from new LAN checks ### 📊 Changes **2 files changed** (+53 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+2 -0) 📝 `tools/lan_e2e.py` (+51 -0) </details> ### 📄 Description > 🤖 Opened by rdbt's AI agent (OpenCode, agentrouter/gpt-6.1-sol). ## What and why Fixes #1299. Dimension entry applies the game mode to the old player and then removes that body. The replacement created in `remote_teleport` receives the server's cached flight abilities, but its spectator collision flag remained at its default `false`. - Initialize the replacement body's spectator flag from the current game mode. - Add the `spectator-travel` LAN end-to-end check: enter the Nether and return to the Overworld while remaining a spectator, fly through a verified stone wall in each dimension, and check both client and authoritative positions. It covers the integrated-server host, LAN guest, and in-frame host. The gameplay fix is two added lines; the regression is 51 lines. ## Vanilla reference Read the pinned Minecraft 26.3 bytecode with `tools/rea_vanilla.py`: - `net.minecraft.world.entity.player.Player.tick`: sets `noPhysics = isSpectator()` before movement. - `net.minecraft.client.multiplayer.ClientPacketListener.handleRespawn`: creates the replacement `LocalPlayer`, installs it, and retains/applies the spawn's game mode. Gameplay regression: `tools/lan_e2e.py --check spectator-travel`, also with `--server-thread`. ## Regression verification Ran the checked-in LAN harness through a local Xvfb adapter, using the freshly built `target/fast` binaries and prepared 26.3 resources from the main checkout. All game data and settings were isolated in temporary folders. Before the fix, the server-thread host remained in spectator mode with flight enabled but stopped at Z=2.70 on both the client and server, against the wall at Z=3. The new regression failed on that collision. After the fix: | Player/path | Nether client/server Z | Overworld client/server Z | | --- | --- | --- | | Server-thread host | 12.48 / 12.74 | 11.45 / 11.59 | | LAN guest | 13.43 / 13.43 | 10.93 / 11.07 | | In-frame host | 14.97 / 15.26 | 10.93 / 11.07 | Every case retained spectator flight and passed the stone wall in both views without cycling game mode. The regression also captures before/after screenshots for each traversal. ## Self-check **pr_ready** (`tools/pr_ready.py` on archlinux, against origin/main at 947d65e64, 3 min 43 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +53 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 252 passed (2 min 7 s) | | rustfmt | ✅ (39 s) | | clippy | ✅ (3 s) | | tests: horizon-client | ✅ 1200 passed (46 s) | | doc tests | ✅ 0 passed (7 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The worktree has no prepared `.local/` for the parity runner; the vanilla parity suite remains for the maintainer/CI run. 🤖 Generated with [OpenCode](https://opencode.ai) (agentrouter/gpt-6.1-sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:40 +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#3718
No description provided.