Skip to main content

Module state

Module state 

Source
Expand description

Fluid state <-> block state conversions.

Responsible for deriving FluidState from BlockState and converting FluidState back into BlockStateId.

Constantsยง

FALLING_FLOW_DOWNWARD ๐Ÿ”’
FLOW_BELOW_HEIGHT_OFFSET ๐Ÿ”’

Functionsยง

affects_flow_with ๐Ÿ”’
fluid_state_to_block
Converts a FluidState into a BlockStateId directly without preserving any block.
fluid_state_to_block_with_existing
Converts a FluidState into a BlockStateId, preserving the identity of an existing block.
get_flow
Returns vanilla FlowingFluid.getFlow for this fluid state.
get_flow_with ๐Ÿ”’
get_fluid_state
Gets the fluid state at a given position.
get_fluid_state_from_block
Gets the fluid state from a raw BlockStateId.
get_height
Returns the effective fluid height at a position, accounting for fluid above. If the same fluid type occupies the block directly above (hasSameAbove), the height is 1.0 (full block). Otherwise it is get_own_height(fluid_state).
get_height_with ๐Ÿ”’
get_own_height
Returns the fluidโ€™s own height as a fraction of a full block. amount / 9.0 โ€” source blocks have amount = 8, giving 0.888... Flowing blocks range from amount = 1 (thin) to 7 (tall).
is_solid_face_with ๐Ÿ”’
lava_id
Gets the lava source fluid ref from the registry.
water_id
Gets the water source fluid ref from the registry.