-
Bug
-
Resolution: Duplicate
-
None
-
1.16.2
-
None
-
Unconfirmed
-
Survival
-
(Unassigned)
Buckets of water can be emptied in empty water source blocks and water blocks with replaceable waterlogged blocks (seagrass etc.), but not in the source blocks with waterlogged blocks that aren't replaceable (slabs, stairs, etc.).
What I expected to happen:
I expected a bucket being able to be emptied in a water source block that contains any waterlogged block.
What actually happened:
I emptied a bucket of water in a waterlogged slab, and the water was instead placed in the block above the slab rather than in the slab.
More specifically:
- Water buckets can be emptied in empty water source blocks
- Water buckets can be emptied in any waterlogged block you can immediately replace by another block (e.g. seagrass)
- Water buckets can not be emptied in any waterlogged block that you have to destroy before you can place another block in it
Steps to reproduce
- Make a shallow 1x1x1 pool of water
- In survival mode: empty a bucket of water in the pool
The water in the bucket disappears and no water is placed - as intended - Place seagrass in the pool
- In survival mode: empty a bucket of water in the pool that contains the seagrass
The water in the bucket disappears and no water is placed - again intended - Place a slab in the pool, make sure it's waterlogged
- In survival mode: empty a bucket of water in the pool that contains the slab
The water in the bucket is either placed in the block above the pool to empty the bucket, or is not placed and the bucket is not emptied - not intended: the water should be placed in the slab even though it's waterlogged
Logic behind the bug
When placing water a basic decision is made whether water can be placed in a certain position. This check first checks if the block accepts water for waterlogging, and if not it checks whether it can be replaced by water. Then, when that check passes the block where the water is placed is set to its waterlogged state, if possible, and else it replaces the block with water. If the check fails, it tries to place water in an adjacent block rather than the targeted block by doing the same logic. If the check then fails again the water is not placed. More specifically:
- Check 1: Does the block accept water (can you waterlog the block)?
- Check 2: Is the block replaceable (can you place another block in it without having to break the old block)
- If either of these checks pass, the water may be placed, otherwise the same logic is tried to an adjacent block
- If the block is a water container, set the waterlogged state of water
- If the block is replaceable, replace the block with water
Analyzing this logic against several blocks to place water in:
- Check 1: Air is logically not a water container and thus not waterloggable (waterlogged air is identified as water instead of air)
- Check 2: Air is logically replaceable (you can place another block in it without having to destroy the air)
- Check passes
- Air is not a water container so waterlogging air fails
- Air is replaceable so the air is replaced by a block of water
- Works as intended
- Check 1: Water is logically not a water container and thus not waterloggable (it is water itself but in the code it does not implement the water container interface)
- Check 2: Water is logically replaceable
- Check passes
- Water is not a water container so waterlogging water fails
- Water is replaceable so the water is replaced by a block of water (effectively not changing the world)
- Works as intended
- Check 1: Seagrass is a water container (because it is a block in water) but rejects waterlogging ()
- Check 2: Seagrass is logically replaceable
- Check passes
- Seagrass is a water container so waterlogging works, even though in the check it rejected the water
- Works as intended
Seagrass should accept waterlogging to optimize the algorithm, even though this works
- Check 1: A slab is a water container (because you can waterlog slabs) and accepts waterlogging
- Check 2: A slab is logically not replaceable
- Check passes
- Slab is a water container so waterlogging works
- Works as intended
- Check 1: A waterlogged slab is a water container (because it is already waterlogged) but rejects waterlogging ()
- Check 2: A waterlogged slab is logically not replaceable
- Check fails, and the block is replaced on an adjacent block
A waterlogged slab should accept waterlogging to be able to drain water in it: this is the bug!
- duplicates
-
MC-127110 You can't empty water buckets into waterlogged blocks
- Resolved