[PR #7238] [MERGED] tools: an end-to-end check that flowing water pushes a boat (#6435) #7433

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7238
Author: @JustKarkat
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/boat-current


📝 Commits (1)

  • aa73ebe tools: an end-to-end check that flowing water pushes a boat

📊 Changes

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

View changed files

➕ tools/boat_current_e2e.py (+145 -0)

📄 Description

A test-only guard for #6435: a boat in flowing water must be pushed by the current.

Vanilla AbstractBoat.tick calls super.tick() first, so Entity.baseTick's updateFluidInteraction adds the water current (scale 0.014) to the boat's velocity, and only then floatBoat scales the velocity and controlBoat/move run. game::boats::tick_boat now does the same through the shared Entity::push_by_fluid (added with the vehicle fluid work, present in #7037); this script pins the behaviour down end to end.

What it does: a headless single-player game (horizon-ctl launch --headless), a one-deep three-wide stone trench fed by one source block at its head, an oak boat summoned on the flowing water, and the boat's Pos read every ten ticks. It fails when the boat does not drift.

A/B on this branch's base (8ee723689):

  • with tick_boat's push_by_fluid call: boat x 2.790 -> 6.796 over 30 ticks (+4.006), PASS
  • with that one call commented out: boat x 2.500 -> 2.500 (+0.000), FAIL as intended

The report is about a ridden boat; a ridden boat ticks through the same tick_boat (remote_ride calls it with controlled = true), so the unridden tick covers the same current step. The script rides nothing because the control socket cannot mount a boat: boats are not listed by entities, and look-at entity/interact-entity only resolve mobs.

Run: python3 tools/boat_current_e2e.py --bin-dir target/fast (needs the prepared .local/horizon-client resources; --resources points at a different prepared folder, e.g. from a worktree).

Refs #6435.


🔄 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/7238 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/boat-current` --- ### 📝 Commits (1) - [`aa73ebe`](https://github.com/horizon-rust/horizon/commit/aa73ebe5e144ba722d8dcbba28634b130d4c1521) tools: an end-to-end check that flowing water pushes a boat ### 📊 Changes **1 file changed** (+145 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tools/boat_current_e2e.py` (+145 -0) </details> ### 📄 Description A test-only guard for #6435: a boat in flowing water must be pushed by the current. Vanilla `AbstractBoat.tick` calls `super.tick()` first, so `Entity.baseTick`'s `updateFluidInteraction` adds the water current (scale `0.014`) to the boat's velocity, and only then `floatBoat` scales the velocity and `controlBoat`/`move` run. `game::boats::tick_boat` now does the same through the shared `Entity::push_by_fluid` (added with the vehicle fluid work, present in #7037); this script pins the behaviour down end to end. What it does: a headless single-player game (`horizon-ctl launch --headless`), a one-deep three-wide stone trench fed by one source block at its head, an oak boat summoned on the flowing water, and the boat's `Pos` read every ten ticks. It fails when the boat does not drift. A/B on this branch's base (`8ee723689`): - with `tick_boat`'s `push_by_fluid` call: boat x 2.790 -> 6.796 over 30 ticks (+4.006), PASS - with that one call commented out: boat x 2.500 -> 2.500 (+0.000), FAIL as intended The report is about a ridden boat; a ridden boat ticks through the same `tick_boat` (`remote_ride` calls it with `controlled = true`), so the unridden tick covers the same current step. The script rides nothing because the control socket cannot mount a boat: boats are not listed by `entities`, and `look-at entity`/`interact-entity` only resolve mobs. Run: `python3 tools/boat_current_e2e.py --bin-dir target/fast` (needs the prepared `.local/horizon-client` resources; `--resources` points at a different prepared folder, e.g. from a worktree). Refs #6435. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:39:28 +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#7433
No description provided.