[PR #5993] [MERGED] Boats can't be placed from underwater #6599

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

📋 Pull Request Information

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

Base: main ← Head: fix/boat-underwater


📝 Commits (1)

  • dd3e33c Boats can't be placed from underwater

📊 Changes

1 file changed (+27 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/boats.rs (+27 -1)

📄 Description

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

What and why

A boat placed while the player's head is underwater now lands at the eye and collides with the player (nothing is placed), as in vanilla.

Cause: boat_to_place (crates/horizon-client/src/game/boats.rs) snapped every fluid hit to the top of the water cell. Vanilla BoatItem.use takes getPlayerPOVHitResult(..., ClipContext.Fluid.ANY), which clips the fluid shape. A full-height cell (same fluid above) is a full cube, and VoxelShape.clip on a ray starting inside returns from + delta * 0.001 (bytecode: VoxelShape.clip, 1.0E-7 length check, 0.001 scale, isFullWide -> BlockHitResult). BoatItem.getBoat then uses HitResult.getLocation() as the boat's initial pos, and Level.noCollision(boat, box) fails against the player.

Change: new fluid_hit_point: full-height cell keeps the ray point, partial cell still snaps to its surface. Unit test added.

Fixes #5967

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

BoatItem.use (getPlayerPOVHitResult with ClipContext.Fluid.ANY), BoatItem.getBoat (places at HitResult.getLocation()), VoxelShape.clip (a ray starting inside a full cube returns from + delta * 0.001), Level.noCollision.

Test: a unit test on fluid_hit_point. Valkyrie tested by hand in game: boats can't be placed with the head underwater, and can be with the head above the surface. Not checked: partial-height water with the eye inside keeps the old surface snap, unproven against vanilla.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at 4789f92dd, 2 min 17 s)

Check Result
Scope ✅ 3 files, +28 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (19 s)
rustfmt ✅ (6 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅
tests: horizon-client ✅ 1699 passed (1 min 50 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 ➖ 318 affected, to run in CI (--quick): block_removal, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair, chorus_plant and 306 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/5993 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/boat-underwater` --- ### 📝 Commits (1) - [`dd3e33c`](https://github.com/horizon-rust/horizon/commit/dd3e33c0ecb26df07a82564b3b9ca0af575cbc65) Boats can't be placed from underwater ### 📊 Changes **1 file changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/boats.rs` (+27 -1) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why A boat placed while the player's head is underwater now lands at the eye and collides with the player (nothing is placed), as in vanilla. Cause: `boat_to_place` (crates/horizon-client/src/game/boats.rs) snapped every fluid hit to the top of the water cell. Vanilla `BoatItem.use` takes `getPlayerPOVHitResult(..., ClipContext.Fluid.ANY)`, which clips the fluid shape. A full-height cell (same fluid above) is a full cube, and `VoxelShape.clip` on a ray starting inside returns `from + delta * 0.001` (bytecode: `VoxelShape.clip`, 1.0E-7 length check, 0.001 scale, `isFullWide` -> BlockHitResult). `BoatItem.getBoat` then uses `HitResult.getLocation()` as the boat's initial pos, and `Level.noCollision(boat, box)` fails against the player. Change: new `fluid_hit_point`: full-height cell keeps the ray point, partial cell still snaps to its surface. Unit test added. Fixes #5967 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `BoatItem.use` (`getPlayerPOVHitResult` with `ClipContext.Fluid.ANY`), `BoatItem.getBoat` (places at `HitResult.getLocation()`), `VoxelShape.clip` (a ray starting inside a full cube returns `from + delta * 0.001`), `Level.noCollision`. Test: a unit test on `fluid_hit_point`. Valkyrie tested by hand in game: boats can't be placed with the head underwater, and can be with the head above the surface. Not checked: partial-height water with the eye inside keeps the old surface snap, unproven against vanilla. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at 4789f92dd, 2 min 17 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +28 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (19 s) | | rustfmt | ✅ (6 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ | | tests: horizon-client | ✅ 1699 passed (1 min 50 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 | ➖ 318 affected, to run in CI (--quick): block_removal, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair, chorus_plant and 306 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:37 +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#6599
No description provided.