mojira.dev
MC-133814

Seagrass, kelp, coral and coral fans become waterlogged when placed in downwards flowing water

They should only become waterlogged when placed inside a water source block. To reproduce:

1. Dig a 1x1 two deep hole
2. Place a water source block on the top air block
3. Place a coral on the bottom
4. Remove the water source block from the top

Code Analysis:
Code analysis by @unknown can be found in this comment.

Linked issues

Comments 10

Isnt that because the new water flow algorithm

Isnt that because the new water flow algorithm

Confirmed for 1.13.1-pre1

Confirmed for 1.13.1

Can't seem to reproduce this with sea pickles in 21w06a. Are there any other blocks that this works with?

Can confirm in 1.19.4 Pre-release 1.

Affect coral, coral fan, seagrass, kelp.

Can confirm in 1.19.4 Pre-release 1.

Affect coral, coral fan, seagrass, kelp.

Code Analysis:

The reason for this happening is due to the returned blockstate in the getStateForPlacement() method for kelp, coral plant/fan, and seagrass. All of these blocks add an additional check at the end of the return value "&& fluidState.getAmount() == 8" which checks to see if the blockstate occupying where the player is clicking is a level 8 (so it does not check for a "source block", but rather just level 8).

@Override
    @Nullable
    public BlockState getStateForPlacement(BlockPlaceContext blockPlaceContext) {
        FluidState fluidState = blockPlaceContext.getLevel().getFluidState(blockPlaceContext.getClickedPos());
        return (BlockState)this.defaultBlockState().setValue(WATERLOGGED, fluidState.is(FluidTags.WATER) && fluidState.getAmount() == 8);
    }
Minecraft386882

Confirmed in 1.21.3

Minecraft386882

Confirmed in 1.21.4 prerelease 2

[Mod] redstonehelper

(Unassigned)

Confirmed

Block states

waterlogged-blocks

Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.14.2, ..., 1.19.4, 23w17a, 1.20.1, 1.20.2, 1.21.3

Retrieved