[PR #3656] [MERGED] Place and collect water in waterlogged blocks #5129

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

📋 Pull Request Information

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

Base: main ← Head: fix/waterlogged-bucket


📝 Commits (2)

  • e83ef39 Place and collect water in waterlogged blocks
  • 3da5312 Fix the bucket test after the barrier case

📊 Changes

8 files changed (+279 additions, -99 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+78 -59)
📝 crates/horizon-client/src/game/dispenser.rs (+5 -3)
📝 crates/horizon-client/src/game/powder_snow.rs (+3 -2)
📝 crates/horizon-client/src/game/remote.rs (+62 -0)
📝 crates/horizon-world/src/level/buckets.rs (+41 -13)
📝 crates/horizon-world/src/level/fluids.rs (+39 -10)
📝 crates/horizon-world/src/level/hooks.rs (+1 -1)
📝 crates/horizon-world/src/level/tests.rs (+50 -11)

📄 Description

Opened by jaszkus's AI agent, not by jaszkus himself.

Fixes #3592

What and why

A water bucket now fills the clicked block itself when that block can hold water (LiquidBlockContainer / SimpleWaterloggedBlock: stairs, slabs, fences, trapdoors, ...), instead of pouring into the block next to it. An empty bucket's SOURCE_ONLY ray also targets waterlogged blocks, so their water can be collected again.

From #3592:

What I did: Placed water in a slab, trapdoor, stair, or fence. Tried to collect the water with a bucket.

What happened: The water cannot be collected.

What I expected: The water should be collectable with a bucket.

Also ported:

  • BucketItem.emptyContents' canPlaceFluidInsideBlock: only air takes a fluid while sneaking.
  • BarrierBlock.canPlaceLiquid / pickupBlock: only a creative player waterlogs or drains one.
  • An empty bucket on a block that gives nothing now returns FAIL (the click is consumed, the off hand is not tried) instead of PASS.
  • Creative empty-bucket pickup goes through ItemUtils.createFilledResult: the filled bucket is added instead of being lost.
  • The client runs BucketItem.use locally on a dry level, so the click result and the predicted blocks are the client's own; a failed fill or pickup no longer swings.

Note: #3638 by @SU4G3 independently fixes the pickup half (its pick_fluid change also helps the glass bottle). This PR is the broader implementation for the issue claimed on Discord by jaszkus before that PR; the two do not conflict in code, and the maintainers can prefer either.

Vanilla reference

BucketItem.use / emptyContents, BucketPickup.pickupBlock, SimpleWaterloggedBlock, LiquidBlockContainer, BarrierBlock, StairBlock.getStateForPlacement, SlabBlock.getStateForPlacement, FlowingFluid.spreadTo. Unit tests cover source pickup, draining a waterlogged slab, the sneak rule, and the barrier's creative rule.

Self-check

Not run locally; CI's verify and parity jobs cover the branch.


🔄 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/3656 **Author:** [@jaszkus](https://github.com/jaszkus) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/waterlogged-bucket` --- ### 📝 Commits (2) - [`e83ef39`](https://github.com/horizon-rust/horizon/commit/e83ef39df44e7d6caa397b09b52f5ae953059a18) Place and collect water in waterlogged blocks - [`3da5312`](https://github.com/horizon-rust/horizon/commit/3da531255a9473f16bfd2398c937621f07854bd6) Fix the bucket test after the barrier case ### 📊 Changes **8 files changed** (+279 additions, -99 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+78 -59) 📝 `crates/horizon-client/src/game/dispenser.rs` (+5 -3) 📝 `crates/horizon-client/src/game/powder_snow.rs` (+3 -2) 📝 `crates/horizon-client/src/game/remote.rs` (+62 -0) 📝 `crates/horizon-world/src/level/buckets.rs` (+41 -13) 📝 `crates/horizon-world/src/level/fluids.rs` (+39 -10) 📝 `crates/horizon-world/src/level/hooks.rs` (+1 -1) 📝 `crates/horizon-world/src/level/tests.rs` (+50 -11) </details> ### 📄 Description Opened by jaszkus's AI agent, not by jaszkus himself. Fixes #3592 ## What and why A water bucket now fills the clicked block itself when that block can hold water (`LiquidBlockContainer` / `SimpleWaterloggedBlock`: stairs, slabs, fences, trapdoors, ...), instead of pouring into the block next to it. An empty bucket's `SOURCE_ONLY` ray also targets waterlogged blocks, so their water can be collected again. From #3592: > What I did: Placed water in a slab, trapdoor, stair, or fence. Tried to collect the water with a bucket. > > What happened: The water cannot be collected. > > What I expected: The water should be collectable with a bucket. Also ported: - `BucketItem.emptyContents`' `canPlaceFluidInsideBlock`: only air takes a fluid while sneaking. - `BarrierBlock.canPlaceLiquid` / `pickupBlock`: only a creative player waterlogs or drains one. - An empty bucket on a block that gives nothing now returns FAIL (the click is consumed, the off hand is not tried) instead of PASS. - Creative empty-bucket pickup goes through `ItemUtils.createFilledResult`: the filled bucket is added instead of being lost. - The client runs `BucketItem.use` locally on a dry level, so the click result and the predicted blocks are the client's own; a failed fill or pickup no longer swings. Note: #3638 by @SU4G3 independently fixes the pickup half (its `pick_fluid` change also helps the glass bottle). This PR is the broader implementation for the issue claimed on Discord by jaszkus before that PR; the two do not conflict in code, and the maintainers can prefer either. ## Vanilla reference `BucketItem.use` / `emptyContents`, `BucketPickup.pickupBlock`, `SimpleWaterloggedBlock`, `LiquidBlockContainer`, `BarrierBlock`, `StairBlock.getStateForPlacement`, `SlabBlock.getStateForPlacement`, `FlowingFluid.spreadTo`. Unit tests cover source pickup, draining a waterlogged slab, the sneak rule, and the barrier's creative rule. ## Self-check Not run locally; CI's verify and parity jobs cover the branch. --- <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: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#5129
No description provided.