[PR #6274] [MERGED] A boat stops when its rider gets out #6758

Closed
opened 2026-11-03 06:26:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6274
Author: @MSedgeMC
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/gp-boat-momentum


📝 Commits (1)

  • 9425bb9 A boat stops when its rider gets out

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/boats.rs (+7 -0)

📄 Description

Vanilla never carries a boat's riding momentum into the level: while a player's client drives a boat, the level-side copy is not authoritative and AbstractBoat.tick drops its motion every tick, so the boat is at rest the moment the rider gets out.

119: invokevirtual  Entity.isLocalInstanceAuthoritative():Z
123: ifeq           198      // this side does not drive the boat
184: move(MoverType.SELF, getDeltaMovement())        // the driving side only
198: setDeltaMovement(Vec3.ZERO)
205: putfield       deltaRotation = 0.0

Entity.isLocalInstanceAuthoritative is !isClientAuthoritative() on a level's side, and isClientAuthoritative is getControllingPassenger() != null && controllingPassenger.isClientAuthoritative(): the boat a player rides is driven by that player's client, and the level's copy sits at zero velocity until somebody else drives it.

Horizon's Game::dismount (crates/horizon-client/src/game/boats.rs) only moved the player out and left the boat's velocity and delta_rotation as the ride left them. Unridden boats tick through floatBoat, so the boat coasted on with the 0.9 drag for about two seconds and turned with its old spin, which is what the report describes.

dismount is the one path every way of leaving a boat goes through in this client: sneaking, the 60-tick out-of-control ejection, a down bubble column, a spectator switch (game_mode.rs) and a LAN guest getting out (lan_vehicles.rs) all call it. It now drops both fields, matching the non-authoritative branch. The boat's status is refreshed by the next tick, as vanilla's getStatus does.

Proven: cargo test -q -p horizon-client --bin horizon-client boat -> 13 passed on the build VM (the client's boat tests, no regression).

Not proven: the game itself: ride a boat forward in water and get out, and the boat should stand still where it was left, including a boat on ice and one a down bubble column ejects. There is no headless test for Game::dismount (it needs a loaded world and a player), so this hand-off is verified by reading, not by a run.

Known limit: a boat that is pushed by a mob or by a piston while empty still coasts through floatBoat, which is the level-side copy vanilla also simulates.


🔄 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/6274 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/gp-boat-momentum` --- ### 📝 Commits (1) - [`9425bb9`](https://github.com/horizon-rust/horizon/commit/9425bb9acf0665911db5ad3763add1721244a816) A boat stops when its rider gets out ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/boats.rs` (+7 -0) </details> ### 📄 Description Vanilla never carries a boat's riding momentum into the level: while a player's client drives a boat, the level-side copy is not authoritative and `AbstractBoat.tick` drops its motion every tick, so the boat is at rest the moment the rider gets out. ``` 119: invokevirtual Entity.isLocalInstanceAuthoritative():Z 123: ifeq 198 // this side does not drive the boat 184: move(MoverType.SELF, getDeltaMovement()) // the driving side only 198: setDeltaMovement(Vec3.ZERO) 205: putfield deltaRotation = 0.0 ``` `Entity.isLocalInstanceAuthoritative` is `!isClientAuthoritative()` on a level's side, and `isClientAuthoritative` is `getControllingPassenger() != null && controllingPassenger.isClientAuthoritative()`: the boat a player rides is driven by that player's client, and the level's copy sits at zero velocity until somebody else drives it. Horizon's `Game::dismount` (`crates/horizon-client/src/game/boats.rs`) only moved the player out and left the boat's `velocity` and `delta_rotation` as the ride left them. Unridden boats tick through `floatBoat`, so the boat coasted on with the 0.9 drag for about two seconds and turned with its old spin, which is what the report describes. `dismount` is the one path every way of leaving a boat goes through in this client: sneaking, the 60-tick out-of-control ejection, a down bubble column, a spectator switch (`game_mode.rs`) and a LAN guest getting out (`lan_vehicles.rs`) all call it. It now drops both fields, matching the non-authoritative branch. The boat's status is refreshed by the next tick, as vanilla's `getStatus` does. **Proven:** `cargo test -q -p horizon-client --bin horizon-client boat` -> 13 passed on the build VM (the client's boat tests, no regression). **Not proven:** the game itself: ride a boat forward in water and get out, and the boat should stand still where it was left, including a boat on ice and one a down bubble column ejects. There is no headless test for `Game::dismount` (it needs a loaded world and a player), so this hand-off is verified by reading, not by a run. Known limit: a boat that is pushed by a mob or by a piston while empty still coasts through `floatBoat`, which is the level-side copy vanilla also simulates. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:12 +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#6758
No description provided.