[PR #6453] [MERGED] Push a boat by the current it sits in #6882

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

📋 Pull Request Information

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

Base: main ← Head: fix/boat-fluid-current


📝 Commits (2)

  • 75d84aa Push a boat by the current it sits in
  • f252ef5 Drop a needless conversion in the boat's eye height

📊 Changes

3 files changed (+65 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+1 -0)
📝 crates/horizon-client/src/entities/fluids.rs (+54 -1)
📝 crates/horizon-client/src/game/boats.rs (+10 -0)

📄 Description

A boat is pushed by fluid: AbstractBoat does not override isPushedByFluid, so
Entity.baseTick's updateFluidHeightAndDoFluidPushing runs for it and adds
getFluidFlow(...) * 0.014 for water (0.0023333 for lava, 0.007 with fast lava) to the
entity's delta on every tick - before AbstractBoat.floatBoat scales that delta with the
status' friction.

Horizon's tick_boat went straight from the status to floatBoat, so a boat in a flowing
trench kept the velocity its own physics gave it and ignored the current entirely. On a
server the same boat is predicted by vanilla rules, which is why paddling through flowing
water drifted off the server's position and tripped GrimAC's Simulation check (#6435:
21 alerts in flowing water, 0 in source water, 0 for a vanilla client).

The boat now runs the shared fluid step (entities::update_entity_fluids, already used by
dropped items and armour stands) on its own box, with the boat's eye at the top of its
0.5625-block hull, at the same point in the tick vanilla runs it.

Proven: on the build VM,
cargo test -q -p horizon-client-lib --lib a_boat_box_is_pushed_by_the_current_it_sits_in
→ 1 passed: a 1.375 x 0.5625 boat box in source water gets no horizontal push, and the
same box next to a water[level=1] block gains velocity along +x.
cargo test -q -p horizon-client --lib boats → 6 passed,
cargo test -q -p horizon-client-lib --lib entities::fluids → 3 passed,
cargo check -q -p horizon-client --lib → clean.

Not proven: the GrimAC result itself; the check is the report's own run - paddle the same
boat through the flowing trench on a Paper server with GrimAC and look for Simulation
alerts, which were 21 before and should be 0.

One limit: this covers the current, not a boat's own buoyancy in a waterfall's downward flow
(getFluidFallingAdjustedMovement for a boat is part of the same vanilla method; the falling
adjustment is applied to entities that are not on ground, and a boat's status already gives it
-0.04 sinking each tick, so the two are not yet reconciled).


🔄 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/6453 **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/boat-fluid-current` --- ### 📝 Commits (2) - [`75d84aa`](https://github.com/horizon-rust/horizon/commit/75d84aaacddfaa1132a1905fd7b9c86f446651dd) Push a boat by the current it sits in - [`f252ef5`](https://github.com/horizon-rust/horizon/commit/f252ef542d9073ce618ffc0eac55b2c41d5e9dcb) Drop a needless conversion in the boat's eye height ### 📊 Changes **3 files changed** (+65 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+1 -0) 📝 `crates/horizon-client/src/entities/fluids.rs` (+54 -1) 📝 `crates/horizon-client/src/game/boats.rs` (+10 -0) </details> ### 📄 Description A boat is pushed by fluid: `AbstractBoat` does not override `isPushedByFluid`, so `Entity.baseTick`'s `updateFluidHeightAndDoFluidPushing` runs for it and adds `getFluidFlow(...) * 0.014` for water (0.0023333 for lava, 0.007 with fast lava) to the entity's delta on every tick - before `AbstractBoat.floatBoat` scales that delta with the status' friction. Horizon's `tick_boat` went straight from the status to `floatBoat`, so a boat in a flowing trench kept the velocity its own physics gave it and ignored the current entirely. On a server the same boat is predicted by vanilla rules, which is why paddling through flowing water drifted off the server's position and tripped GrimAC's `Simulation` check (#6435: 21 alerts in flowing water, 0 in source water, 0 for a vanilla client). The boat now runs the shared fluid step (`entities::update_entity_fluids`, already used by dropped items and armour stands) on its own box, with the boat's eye at the top of its 0.5625-block hull, at the same point in the tick vanilla runs it. **Proven:** on the build VM, `cargo test -q -p horizon-client-lib --lib a_boat_box_is_pushed_by_the_current_it_sits_in` → `1 passed`: a 1.375 x 0.5625 boat box in source water gets no horizontal push, and the same box next to a `water[level=1]` block gains velocity along +x. `cargo test -q -p horizon-client --lib boats` → 6 passed, `cargo test -q -p horizon-client-lib --lib entities::fluids` → 3 passed, `cargo check -q -p horizon-client --lib` → clean. **Not proven:** the GrimAC result itself; the check is the report's own run - paddle the same boat through the flowing trench on a Paper server with GrimAC and look for `Simulation` alerts, which were 21 before and should be 0. One limit: this covers the current, not a boat's own buoyancy in a waterfall's downward flow (`getFluidFallingAdjustedMovement` for a boat is part of the same vanilla method; the falling adjustment is applied to entities that are not on ground, and a boat's status already gives it `-0.04` sinking each tick, so the two are not yet reconciled). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:28:35 +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#6882
No description provided.