[PR #3638] [CLOSED] Buckets pick up the water of waterlogged blocks #5112

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3638
Author: @SU4G3
Created: 10/29/2026
Status: ❌ Closed

Base: main ← Head: fix/bucket-waterlogged-3592


📝 Commits (1)

  • eb2879f Buckets pick up the water of waterlogged blocks

📊 Changes

1 file changed (+50 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+50 -6)

📄 Description

🤖 Written with my AI agent (Claude).

Fixes #3592

What

An empty bucket picks up the water of a waterlogged block (slab, stairs, trapdoor, fence...) again: the block loses waterlogged and the bucket becomes a water bucket, as in vanilla.

Why

pick_fluid (crates/horizon-client/src/game.rs), the ray BucketItem.use runs, stepped through waterlogged blocks: it skipped them as fluid (!f.waterlogged) and as solid blocks (they hold a fluid), so the bucket hit whatever lay behind and returned PASS. Vanilla's ClipContext.Fluid.SOURCE_ONLY stops there, because SimpleWaterloggedBlock.getFluidState is a water source, and the block is a BucketPickup. The ray's predicate is now stops_source_only_ray, which also stops at a waterlogged source; Sim::bucket_pickup (horizon-world/src/level/buckets.rs) already drained SimpleWaterlogged blocks, so nothing else changes there. Seagrass and kelp (water of their own, no waterlogged property) are still looked past, as before.

pick_fluid is also the glass bottle's ray (game/potions.rs), so a bottle aimed at a waterlogged block now fills with water, which is what vanilla's BottleItem.use does too. I did not test the bottle in game.

Verification

Offscreen, fresh mktemp -d homes, --profile fast: setblock an oak_slab[waterlogged=true] two blocks ahead, give an empty bucket, horizon-ctl look-at-block the slab, use-item, then ask the server (the main build is 0b74b68aa; pick_fluid and the bucket code are the same on 4baa57156, this branch's base):

Build Path execute if block … oak_slab[waterlogged=false] clear @s minecraft:water_bucket 0
main 0b74b68aa server thread Test failed No items were found on player …
this branch server thread Test passed Found 1 matching item(s) on player …
main 0b74b68aa --in-frame Test failed No items were found on player …
this branch --in-frame Test passed Found 1 matching item(s) on player …

Unit test: tests::source_only_ray_stops_at_waterlogged_blocks (waterlogged slab, open water and lava sources stop the ray; flowing, falling, seagrass water and plain blocks do not).

pr_ready (tools/pr_ready.py --quick on fedora, against origin/main at 4baa57156, 6 min 13 s)

Check Result
Scope ✅ 8 files, +80 −6
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 408 passed (35 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 2 s)
tests: horizon-client ✅ 801 passed (3 min 55 s)
doc tests ✅ 0 passed (32 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

pr_ready's Scope row counts untracked local game files in my checkout; the commit itself is 1 file, +50 −6.


🔄 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/3638 **Author:** [@SU4G3](https://github.com/SU4G3) **Created:** 10/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/bucket-waterlogged-3592` --- ### 📝 Commits (1) - [`eb2879f`](https://github.com/horizon-rust/horizon/commit/eb2879fbefc7bcf504b8f63a7bc9179082c75b7e) Buckets pick up the water of waterlogged blocks ### 📊 Changes **1 file changed** (+50 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+50 -6) </details> ### 📄 Description > 🤖 Written with my AI agent (Claude). Fixes #3592 ## What An empty bucket picks up the water of a waterlogged block (slab, stairs, trapdoor, fence...) again: the block loses `waterlogged` and the bucket becomes a water bucket, as in vanilla. ## Why `pick_fluid` (`crates/horizon-client/src/game.rs`), the ray `BucketItem.use` runs, stepped through waterlogged blocks: it skipped them as fluid (`!f.waterlogged`) and as solid blocks (they hold a fluid), so the bucket hit whatever lay behind and returned PASS. Vanilla's `ClipContext.Fluid.SOURCE_ONLY` stops there, because `SimpleWaterloggedBlock.getFluidState` is a water source, and the block is a `BucketPickup`. The ray's predicate is now `stops_source_only_ray`, which also stops at a waterlogged source; `Sim::bucket_pickup` (`horizon-world/src/level/buckets.rs`) already drained `SimpleWaterlogged` blocks, so nothing else changes there. Seagrass and kelp (water of their own, no `waterlogged` property) are still looked past, as before. `pick_fluid` is also the glass bottle's ray (`game/potions.rs`), so a bottle aimed at a waterlogged block now fills with water, which is what vanilla's `BottleItem.use` does too. I did not test the bottle in game. ## Verification Offscreen, fresh `mktemp -d` homes, `--profile fast`: `setblock` an `oak_slab[waterlogged=true]` two blocks ahead, give an empty bucket, `horizon-ctl look-at-block` the slab, `use-item`, then ask the server (the main build is 0b74b68aa; `pick_fluid` and the bucket code are the same on 4baa57156, this branch's base): | Build | Path | `execute if block … oak_slab[waterlogged=false]` | `clear @s minecraft:water_bucket 0` | |---|---|---|---| | main 0b74b68aa | server thread | `Test failed` | `No items were found on player …` | | this branch | server thread | `Test passed` | `Found 1 matching item(s) on player …` | | main 0b74b68aa | `--in-frame` | `Test failed` | `No items were found on player …` | | this branch | `--in-frame` | `Test passed` | `Found 1 matching item(s) on player …` | Unit test: `tests::source_only_ray_stops_at_waterlogged_blocks` (waterlogged slab, open water and lava sources stop the ray; flowing, falling, seagrass water and plain blocks do not). **pr_ready** (`tools/pr_ready.py --quick` on fedora, against origin/main at 4baa57156, 6 min 13 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +80 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 408 passed (35 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 2 s) | | tests: horizon-client | ✅ 801 passed (3 min 55 s) | | doc tests | ✅ 0 passed (32 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | pr_ready's Scope row counts untracked local game files in my checkout; the commit itself is 1 file, +50 −6. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:19 +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#5112
No description provided.