Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-197926

Water buckets cannot be emptied in not-replaceable waterlogged blocks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: 1.16.2
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed
    • Game Mode:
      Survival
    • Category:
      (Unassigned)

      Description

      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

      1. Make a shallow 1x1x1 pool of water
      2. In survival mode: empty a bucket of water in the pool
         The water in the bucket disappears and no water is placed - as intended
      3. Place seagrass in the pool
      4. 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
      5. Place a slab in the pool, make sure it's waterlogged
      6. 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:

       

      Place logic
      • 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:

       

      Air
      •  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
      Water
      •  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
      Seagrass
      •  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

      Slab
      •  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
      Waterlogged slab (bug)
      •  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!

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              RGSW Shadew
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: