Skip to main content

fluid_state_to_block_with_existing

Function fluid_state_to_block_with_existing 

Source
pub fn fluid_state_to_block_with_existing(
    fluid_state: FluidState,
    existing_state: BlockStateId,
) -> BlockStateId
Expand description

Converts a FluidState into a BlockStateId, preserving the identity of an existing block.

If existing_state is a waterloggable block, this sets or clears its WATERLOGGED property rather than replacing the block entirely. Otherwise it falls back to the raw fluid block (WATER/LAVA) or AIR for empty fluid.