[PR #4645] [CLOSED] Server: vanilla's floating kick when allow-flight is off #5752

Closed
opened 2026-11-03 05:14:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4645
Author: @ludovic111
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: fix/server-floating-kick


📝 Commits (1)

  • 145aa23 Server: vanilla's floating kick when allow-flight is off

📊 Changes

4 files changed (+258 additions, -17 deletions)

View changed files

📝 crates/horizon-client/src/game/dedicated.rs (+1 -0)
📝 crates/horizon-client/src/lan/guest.rs (+10 -0)
📝 crates/horizon-client/src/lan/hub.rs (+115 -17)
➕ tools/server_floating_e2e.py (+132 -0)

📄 Description

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

Closes #4609.

What and why

Vanilla's dedicated server kicks a player who floats in the air for too long when allow-flight=false, its default. Horizon parsed allow-flight but never used it, so a fly hack was never kicked. This is vanilla parity, always on, not part of the opt-in anticheat (#4607).

Mirrored from ServerGamePacketListenerImpl (26.3):

  • handlePlayerPositionChange sets clientIsFloating after each accepted move. The player floats unless they fell more than 1/32 of a block, the move before this one was stopped from below (verticalCollisionBelow), they are a spectator, the server allows flight, they may fly (creative, spectator), they levitate, glide or riptide, or a block that isn't air is in their box (1/16 wider and 0.55 lower; noBlocksAround).
  • tickPlayer counts the floating ticks of a player who isn't asleep, riding or dying. Past getMaximumFlyingTicks (80 at normal gravity, longer under weaker gravity, never with none), it logs <name> was kicked for floating too long! and disconnects with multiplayer.disconnect.flying ("Flying is not enabled on this server").
  • MinecraftServer.allowFlight is true, and DedicatedServer takes it from allow-flight. So single player, a LAN world and an integrated server never kick, as in vanilla.

Not here: the vehicle half (clientVehicleIsFloating), left to the boat-movement work.

Tests

  • Unit: maximum_flying_ticks against vanilla's formula.
  • tools/server_floating_e2e.py (new), a real dedicated server with horizon-bots:
    • survival, allow-flight=false: a bot that climbs 24 blocks and hovers is kicked for floating, and the console gives vanilla's line; a bot standing on the ground beside it plays on.
    • creative, and survival with allow-flight=true: nobody is kicked.
  • On main's binary, the same script fails: the hovering bot was not kicked.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 6e8e088c2, 5 min 42 s)

Check Result
Scope ✅ 4 files, +258 −17
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (1 min 4 s)
rustfmt ✅ (8 s)
clippy ✅ (37 s)
tests: horizon-client ✅ 1088 passed (3 min 31 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 33 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 21 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Harnesses (tools/parity.py --changed origin/main, Mac mini): 34 of 35 pass (dedicated_server passed on its retry with fresh oracle results). lunge_motion fails, and fails the same way on main (3a5ac7ffe, parity.py --fresh lunge_motion): the vanilla transcript's vertical motion differs at a different step from run to run. It's an integrated-server probe, and an integrated server allows flight, so this change can't reach it.

🤖 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/4645 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/server-floating-kick` --- ### 📝 Commits (1) - [`145aa23`](https://github.com/horizon-rust/horizon/commit/145aa23a7203312e16f6ab48d0c3f39c43bb56c3) Server: vanilla's floating kick when allow-flight is off ### 📊 Changes **4 files changed** (+258 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dedicated.rs` (+1 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+10 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+115 -17) ➕ `tools/server_floating_e2e.py` (+132 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Closes #4609. ## What and why Vanilla's dedicated server kicks a player who floats in the air for too long when `allow-flight=false`, its default. Horizon parsed `allow-flight` but never used it, so a fly hack was never kicked. This is vanilla parity, always on, not part of the opt-in anticheat (#4607). Mirrored from `ServerGamePacketListenerImpl` (26.3): - `handlePlayerPositionChange` sets `clientIsFloating` after each accepted move. The player floats unless they fell more than 1/32 of a block, the move before this one was stopped from below (`verticalCollisionBelow`), they are a spectator, the server allows flight, they may fly (creative, spectator), they levitate, glide or riptide, or a block that isn't air is in their box (1/16 wider and 0.55 lower; `noBlocksAround`). - `tickPlayer` counts the floating ticks of a player who isn't asleep, riding or dying. Past `getMaximumFlyingTicks` (80 at normal gravity, longer under weaker gravity, never with none), it logs `<name> was kicked for floating too long!` and disconnects with `multiplayer.disconnect.flying` ("Flying is not enabled on this server"). - `MinecraftServer.allowFlight` is true, and `DedicatedServer` takes it from `allow-flight`. So single player, a LAN world and an integrated server never kick, as in vanilla. Not here: the vehicle half (`clientVehicleIsFloating`), left to the boat-movement work. ## Tests - Unit: `maximum_flying_ticks` against vanilla's formula. - `tools/server_floating_e2e.py` (new), a real dedicated server with horizon-bots: - survival, `allow-flight=false`: a bot that climbs 24 blocks and hovers is kicked for floating, and the console gives vanilla's line; a bot standing on the ground beside it plays on. - creative, and survival with `allow-flight=true`: nobody is kicked. - On main's binary, the same script fails: `the hovering bot was not kicked`. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 6e8e088c2, 5 min 42 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +258 −17 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (1 min 4 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (37 s) | | tests: horizon-client | ✅ 1088 passed (3 min 31 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 33 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 21 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | **Harnesses** (`tools/parity.py --changed origin/main`, Mac mini): 34 of 35 pass (`dedicated_server` passed on its retry with fresh oracle results). `lunge_motion` fails, and **fails the same way on main** (3a5ac7ffe, `parity.py --fresh lunge_motion`): the vanilla transcript's vertical motion differs at a different step from run to run. It's an integrated-server probe, and an integrated server allows flight, so this change can't reach it. 🤖 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 05:14:45 +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#5752
No description provided.