[PR #3454] [MERGED] Stop swimming and sit up when boarding a boat while swimming #4991

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3454
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix-3308


📝 Commits (1)

  • fd0aeb5 Stop swimming and sit up when boarding a boat while swimming

📊 Changes

3 files changed (+53 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+11 -0)
📝 crates/horizon-client/src/motion.rs (+34 -0)
📝 crates/horizon-client/src/pose.rs (+8 -0)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

What and why

Fixes #3308

If you board a boat while sprint-swimming, you stay in the swimming pose. The eye sits 0.4 above the feet, so the camera is at the boat's waterline and your model lies flat under the boat.

While riding, the remote tick skips controlled_simulation_tick, and that is where the swimming update (fluid_base_tick) and update_player_pose run. So once you're a passenger, nothing clears swimming or recomputes the pose.

The riding branch now runs MotionWorld::passenger_pose_tick. It clears swimming and then runs update_player_pose, which are the two steps vanilla's Player.tick takes for a passenger. The ridden boat is already left out of the player's entity collisions, so the standing pose fits in the seat.

Vanilla reference

  • Entity.rideTick calls tick(), so Entity.baseTick → updateSwimming runs for a passenger too.
  • Entity.updateSwimming: setSwimming(isSprinting() && isInWater() && !isPassenger()) while swimming, otherwise setSwimming(isSprinting() && isUnderWater() && !isPassenger() && fluid is WATER). A passenger never swims.
  • Player.tick ends with updatePlayerPose().

Read with javap -c on the 26.3 client jar. No harness covers the local player's riding tick.

New test: motion::tests::a_passenger_stops_swimming_and_stands. A sprint-swimming player in the swimming pose (eye 0.4) stops swimming, stands, and gets eye 1.62.

Before: passenger_pose_tick as a no-op, which is main's behaviour (nothing runs for a passenger):

test motion::tests::a_passenger_stops_swimming_and_stands ... FAILED
panicked at crates\horizon-client\src\motion.rs:3599:9:
assertion failed: !w.player.swimming

After:

test motion::tests::a_passenger_stops_swimming_and_stands ... ok

Self-check

Run on Windows 11. tools/pr_ready.py and tools/parity.py stop on Windows at signal.SIGHUP, so I ran the steps by hand:

cargo fmt --all -- --check                                                      ok
cargo clippy -p horizon-client --features mods --all-targets -- -D warnings     ok
cargo test -p horizon-client --features mods --lib                              1112 passed, 1 failed*, 32 ignored
cargo test -p horizon-client --features mods --bin horizon-client               139 passed, 3 ignored
python3 tools/check_public_tree.py                                              passed

* save::tests::session_lock_is_exclusive, which fails on Windows on main too.

Screenshots

Singleplayer Creative, fast build. A water basin with an oak boat. I swim to the boat under water with W + Ctrl held, right-click it and keep the keys held for 10 ticks. horizon-ctl state, feet y → eye y while riding:

swimming before the click riding
main (791d8b895) 100.46 → 100.86 (+0.40) 103.11 → 103.51 (+0.40)
this branch 80.46 → 80.86 (+0.40) 83.11 → 84.73 (+1.62)

Before: the boat looks empty in third person, with the player lying under it. After: the player sits in the boat.

before: eye at feet +0.40, the boat looks empty
after: sitting in the boat

🤖 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/3454 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix-3308` --- ### 📝 Commits (1) - [`fd0aeb5`](https://github.com/horizon-rust/horizon/commit/fd0aeb5331f63a85a42f2d36a6ea7fb1cb483d6f) Stop swimming and sit up when boarding a boat while swimming ### 📊 Changes **3 files changed** (+53 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+11 -0) 📝 `crates/horizon-client/src/motion.rs` (+34 -0) 📝 `crates/horizon-client/src/pose.rs` (+8 -0) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Fixes #3308 If you board a boat while sprint-swimming, you stay in the swimming pose. The eye sits 0.4 above the feet, so the camera is at the boat's waterline and your model lies flat under the boat. While riding, the remote tick skips `controlled_simulation_tick`, and that is where the swimming update (`fluid_base_tick`) and `update_player_pose` run. So once you're a passenger, nothing clears `swimming` or recomputes the pose. The riding branch now runs `MotionWorld::passenger_pose_tick`. It clears `swimming` and then runs `update_player_pose`, which are the two steps vanilla's `Player.tick` takes for a passenger. The ridden boat is already left out of the player's entity collisions, so the standing pose fits in the seat. ## Vanilla reference - `Entity.rideTick` calls `tick()`, so `Entity.baseTick` → `updateSwimming` runs for a passenger too. - `Entity.updateSwimming`: `setSwimming(isSprinting() && isInWater() && !isPassenger())` while swimming, otherwise `setSwimming(isSprinting() && isUnderWater() && !isPassenger() && fluid is WATER)`. A passenger never swims. - `Player.tick` ends with `updatePlayerPose()`. Read with `javap -c` on the 26.3 client jar. No harness covers the local player's riding tick. New test: `motion::tests::a_passenger_stops_swimming_and_stands`. A sprint-swimming player in the swimming pose (eye 0.4) stops swimming, stands, and gets eye 1.62. Before: `passenger_pose_tick` as a no-op, which is main's behaviour (nothing runs for a passenger): ``` test motion::tests::a_passenger_stops_swimming_and_stands ... FAILED panicked at crates\horizon-client\src\motion.rs:3599:9: assertion failed: !w.player.swimming ``` After: ``` test motion::tests::a_passenger_stops_swimming_and_stands ... ok ``` ## Self-check Run on Windows 11. `tools/pr_ready.py` and `tools/parity.py` stop on Windows at `signal.SIGHUP`, so I ran the steps by hand: ``` cargo fmt --all -- --check ok cargo clippy -p horizon-client --features mods --all-targets -- -D warnings ok cargo test -p horizon-client --features mods --lib 1112 passed, 1 failed*, 32 ignored cargo test -p horizon-client --features mods --bin horizon-client 139 passed, 3 ignored python3 tools/check_public_tree.py passed ``` \* `save::tests::session_lock_is_exclusive`, which fails on Windows on main too. ## Screenshots Singleplayer Creative, `fast` build. A water basin with an oak boat. I swim to the boat under water with W + Ctrl held, right-click it and keep the keys held for 10 ticks. `horizon-ctl state`, feet y → eye y while riding: | | swimming before the click | riding | |---|---|---| | main (791d8b895) | 100.46 → 100.86 (+0.40) | 103.11 → 103.51 (**+0.40**) | | this branch | 80.46 → 80.86 (+0.40) | 83.11 → 84.73 (**+1.62**) | Before: the boat looks empty in third person, with the player lying under it. After: the player sits in the boat. ![before: eye at feet +0.40, the boat looks empty](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/boat-3308-before.png) ![after: sitting in the boat](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/boat-3308-after.png) 🤖 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:09:26 +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#4991
No description provided.