[PR #1108] [MERGED] Client of a server: abilities from the server, flight sent back (creative flight on the server thread) #3054

Closed
opened 2026-11-02 16:01:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/remote-player-abilities


📝 Commits (3)

  • 86b58b7 Client of a server: abilities from the server, flight sent back
  • f59f6e3 lan_e2e portals: take the portals away afterwards
  • f8d0ef3 Merge main into fix/remote-player-abilities

📊 Changes

4 files changed (+123 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+33 -2)
📝 crates/horizon-client/src/lan/hub.rs (+13 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+14 -0)
📝 tools/lan_e2e.py (+63 -3)

📄 Description

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

What

On a client of a server (single player on its server thread, a LAN guest), a player who joined already in creative couldn't fly: double-tapping jump did nothing.

Why

  • The remote client kept only instabuild and the flying speed from ClientboundPlayerAbilitiesPacket. The motion step clears flying for a player that may not fly, and may_fly was never set.
  • The packet also arrives before the remote client has a player, which is made at the first teleport.
  • A LAN guest got may_fly only from a later game-mode change. Single player creative on the server thread never did. With #1072 making the server thread the default, every creative single-player world would have lost flight.
  • The client also never sent ServerboundPlayerAbilitiesPacket, so the server never knew the player was flying. On the server thread the save then always held flying: false.

How (vanilla 26.3)

  • ClientPacketListener.handlePlayerAbilities sets flying, instabuild, invulnerable, mayfly and both speeds. The remote client now keeps the last packet and applies flying, may fly, invulnerable and the flying speed to the player, also when the player is made.
  • LocalPlayer.onUpdateAbilities (from aiStep: spectator, the double-tap toggle, landing): when the player's flight turns on or off in its tick, the client sends ServerboundPlayerAbilitiesPacket. The packet is one byte, 2 when flying, and is new in horizon-protocol's Serverbound.
  • ServerGamePacketListenerImpl.handlePlayerAbilities: the hub stores flying && mayfly as the guest's flying, which the save writes.
  • GameType.updatePlayerAbilities: set_game_mode now sets the guest's flying (on for spectators, off in survival and adventure, unchanged in creative).
  • New lan_e2e check, flight: the guest, and on the server thread the host's window too, double-tap jump in creative, rise, stay up, and stop flying in survival.

How tested (Mac mini)

  • lan_e2e --check flight:
    • main, --server-thread: FAIL. Host {'flying': False, 'rose': 0.0}; the guest passes because it changed mode after joining.
    • This branch, --server-thread: PASS (host and guest rise 2.87 and stay up).
    • This branch, in-frame: PASS.
  • By hand, single player, creative, double jump:
    • Server thread before: no flight.
    • Server thread after: flying, and still flying after save, quit and reopen. That needs the server to know.
    • In-frame: unchanged.
  • perf_bench's scene start (a zero-length fly, then wait at the start point) never finished on the server thread before, because the player fell to the ground. Now it holds.
  • cargo test -p horizon-protocol: 64 passed, including a new codec test for the serverbound packet.
  • cargo fmt --check. Clippy -D warnings, cargo test -p horizon-client, parity --changed and the full lan_e2e / agent_control_e2e runs in both modes ran on #1072's switch branch, which carries this commit. Results are in that PR.

Labels: feature. A LAN guest who joins a creative world can now fly.

🤖 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/1108 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/remote-player-abilities` --- ### 📝 Commits (3) - [`86b58b7`](https://github.com/horizon-rust/horizon/commit/86b58b71fab6f682201002c2d258996450dde3f0) Client of a server: abilities from the server, flight sent back - [`f59f6e3`](https://github.com/horizon-rust/horizon/commit/f59f6e3e84483ea6a7ef2c76062176260b8b2bf0) lan_e2e portals: take the portals away afterwards - [`f8d0ef3`](https://github.com/horizon-rust/horizon/commit/f8d0ef3cfef3cc83c05f26884411fbe3d86f29a1) Merge main into fix/remote-player-abilities ### 📊 Changes **4 files changed** (+123 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+33 -2) 📝 `crates/horizon-client/src/lan/hub.rs` (+13 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+14 -0) 📝 `tools/lan_e2e.py` (+63 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What On a client of a server (single player on its server thread, a LAN guest), a player who joined already in creative couldn't fly: double-tapping jump did nothing. ## Why - The remote client kept only `instabuild` and the flying speed from `ClientboundPlayerAbilitiesPacket`. The motion step clears `flying` for a player that may not fly, and `may_fly` was never set. - The packet also arrives before the remote client has a player, which is made at the first teleport. - A LAN guest got `may_fly` only from a later game-mode change. Single player creative on the server thread never did. With #1072 making the server thread the default, every creative single-player world would have lost flight. - The client also never sent `ServerboundPlayerAbilitiesPacket`, so the server never knew the player was flying. On the server thread the save then always held `flying: false`. ## How (vanilla 26.3) - `ClientPacketListener.handlePlayerAbilities` sets flying, instabuild, invulnerable, mayfly and both speeds. The remote client now keeps the last packet and applies flying, may fly, invulnerable and the flying speed to the player, also when the player is made. - `LocalPlayer.onUpdateAbilities` (from `aiStep`: spectator, the double-tap toggle, landing): when the player's flight turns on or off in its tick, the client sends `ServerboundPlayerAbilitiesPacket`. The packet is one byte, 2 when flying, and is new in `horizon-protocol`'s `Serverbound`. - `ServerGamePacketListenerImpl.handlePlayerAbilities`: the hub stores `flying && mayfly` as the guest's `flying`, which the save writes. - `GameType.updatePlayerAbilities`: `set_game_mode` now sets the guest's flying (on for spectators, off in survival and adventure, unchanged in creative). - New `lan_e2e` check, `flight`: the guest, and on the server thread the host's window too, double-tap jump in creative, rise, stay up, and stop flying in survival. ## How tested (Mac mini) - `lan_e2e --check flight`: - main, `--server-thread`: **FAIL**. Host `{'flying': False, 'rose': 0.0}`; the guest passes because it changed mode after joining. - This branch, `--server-thread`: PASS (host and guest rise 2.87 and stay up). - This branch, in-frame: PASS. - By hand, single player, creative, double jump: - Server thread before: no flight. - Server thread after: flying, and still flying after save, quit and reopen. That needs the server to know. - In-frame: unchanged. - `perf_bench`'s scene start (a zero-length `fly`, then wait at the start point) never finished on the server thread before, because the player fell to the ground. Now it holds. - `cargo test -p horizon-protocol`: 64 passed, including a new codec test for the serverbound packet. - `cargo fmt --check`. Clippy `-D warnings`, `cargo test -p horizon-client`, parity `--changed` and the full `lan_e2e` / `agent_control_e2e` runs in both modes ran on #1072's switch branch, which carries this commit. Results are in that PR. Labels: `feature`. A LAN guest who joins a creative world can now fly. 🤖 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 16:01:08 +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#3054
No description provided.