[PR #3799] [MERGED] Buckets and bottles pick up the water the eyes are in #5220

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3799
Author: @DenisHumen
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/bucket-eye-block


📝 Commits (1)

  • 01bf07d Buckets and bottles pick up the water the eyes are in

📊 Changes

1 file changed (+126 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+126 -8)

📄 Description

🤖 Opened by DenisHumen's AI agent (Claude Code), not by DenisHumen personally.

What and why

Under water, an empty bucket took the water source at the player's feet (the next one along the ray when looking down) instead of the one the eyes are in, so no air pocket could be made. Glass bottles had the same ray.

pick_fluid starts walking from the eyes' block but only tested a block once the walk moved into a new one, so the starting block was never tested. Vanilla's BlockGetter.traverseBlocks visits the start block first, and VoxelShape.clip hits a shape that contains the ray's start. Now the eyes' own block is tested too, for a source only: what the ray stops at among solid blocks is unchanged, so a ladder or plant at face height does not block the bucket.

Fixes #3787. Fixes #3233.

Vanilla reference

Read from the 26.3 bytecode (javap -c on the client jar; tools/rea_vanilla.py can't start REA on Windows: subprocess doesn't resolve npx.cmd):

  • BlockGetter.traverseBlocks: applies the visitor to floor(lerp(-1e-7, from, to)) before its first step.
  • BlockGetter.lambda$clip$0: clips the block shape and the ClipContext.getFluidShape shape, nearest wins.
  • VoxelShape.clip: when the point from + 1e-7 * (to - from) lies inside the shape, BlockHitResult(from, Direction.getApproximateNearest(delta).getOpposite(), pos, true); otherwise AABB.clip.
  • FlowingFluid.getShape / getHeight / getOwnHeight: a source is the whole block under the same fluid, otherwise amount / 9.0F (8/9) tall.

clip_start_source mirrors those for the start block; two unit tests check inside (down, up, ahead) and above-surface rays. No existing harness covers pick_fluid's ray; happy to add one to a harness you'd prefer.

In the game (horizon-ctl, survival, eyes in block y=101 of a water tank, looking straight down, one use of an empty bucket):

head block (y=101) feet block (y=100) held
upstream/main 64e298952 water air water_bucket
this branch air water water_bucket

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on DenisPC, against upstream/main at a7fa9ad7b, 8 min 46 s)

Check Result
Scope ✅ 1 files, +126 −8
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (2 min 27 s)
rustfmt ✅ (17 s)
clippy ❌ failed (1 min 12 s)
tests: horizon-client ✅ 846 passed (4 min 37 s)
doc tests ✅ 0 passed (2 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 ❌ 360 affected, (5 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Notes on the two ❌, both from this Windows machine rather than the change:

  • clippy: local clippy 1.96 flags lints already on main in files this PR doesn't touch (manual_range_contains in worldgen/aquifer/noise_based.rs:466, nonminimal_bool / overly_complex_bool_expr in mobs/{ai,ambient,tame,warden,axolotl}.rs). With those three allowed, cargo clippy -p horizon-client --all-targets -- -D warnings is clean.
  • Parity: tools/parity.py needs fcntl, which Windows' Python lacks, so no harness ran here; CI's parity with run-parity will.

After rebasing onto 64e298952 the two new tests pass again.

🤖 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/3799 **Author:** [@DenisHumen](https://github.com/DenisHumen) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/bucket-eye-block` --- ### 📝 Commits (1) - [`01bf07d`](https://github.com/horizon-rust/horizon/commit/01bf07dd5d38c78a0f233374b2251234d37771d2) Buckets and bottles pick up the water the eyes are in ### 📊 Changes **1 file changed** (+126 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+126 -8) </details> ### 📄 Description > 🤖 Opened by DenisHumen's AI agent (Claude Code), not by DenisHumen personally. ## What and why Under water, an empty bucket took the water source at the player's feet (the next one along the ray when looking down) instead of the one the eyes are in, so no air pocket could be made. Glass bottles had the same ray. `pick_fluid` starts walking from the eyes' block but only tested a block once the walk moved into a new one, so the starting block was never tested. Vanilla's `BlockGetter.traverseBlocks` visits the start block first, and `VoxelShape.clip` hits a shape that contains the ray's start. Now the eyes' own block is tested too, for a source only: what the ray stops at among solid blocks is unchanged, so a ladder or plant at face height does not block the bucket. Fixes #3787. Fixes #3233. ## Vanilla reference Read from the 26.3 bytecode (`javap -c` on the client jar; `tools/rea_vanilla.py` can't start REA on Windows: `subprocess` doesn't resolve `npx.cmd`): - `BlockGetter.traverseBlocks`: applies the visitor to `floor(lerp(-1e-7, from, to))` before its first step. - `BlockGetter.lambda$clip$0`: clips the block shape and the `ClipContext.getFluidShape` shape, nearest wins. - `VoxelShape.clip`: when the point `from + 1e-7 * (to - from)` lies inside the shape, `BlockHitResult(from, Direction.getApproximateNearest(delta).getOpposite(), pos, true)`; otherwise `AABB.clip`. - `FlowingFluid.getShape` / `getHeight` / `getOwnHeight`: a source is the whole block under the same fluid, otherwise `amount / 9.0F` (8/9) tall. `clip_start_source` mirrors those for the start block; two unit tests check inside (down, up, ahead) and above-surface rays. No existing harness covers `pick_fluid`'s ray; happy to add one to a harness you'd prefer. **In the game** (`horizon-ctl`, survival, eyes in block y=101 of a water tank, looking straight down, one use of an empty bucket): | | head block (y=101) | feet block (y=100) | held | | --- | --- | --- | --- | | upstream/main 64e298952 | water | **air** | water_bucket | | this branch | **air** | water | water_bucket | ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on DenisPC, against upstream/main at a7fa9ad7b, 8 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +126 −8 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (2 min 27 s) | | rustfmt | ✅ (17 s) | | clippy | ❌ failed (1 min 12 s) | | tests: horizon-client | ✅ 846 passed (4 min 37 s) | | doc tests | ✅ 0 passed (2 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 | ❌ 360 affected, (5 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Notes on the two ❌, both from this Windows machine rather than the change: - **clippy**: local clippy 1.96 flags lints already on main in files this PR doesn't touch (`manual_range_contains` in `worldgen/aquifer/noise_based.rs:466`, `nonminimal_bool` / `overly_complex_bool_expr` in `mobs/{ai,ambient,tame,warden,axolotl}.rs`). With those three allowed, `cargo clippy -p horizon-client --all-targets -- -D warnings` is clean. - **Parity**: `tools/parity.py` needs `fcntl`, which Windows' Python lacks, so no harness ran here; CI's `parity` with `run-parity` will. After rebasing onto 64e298952 the two new tests pass again. 🤖 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:11:03 +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#5220
No description provided.