Interface FluidState
- All Superinterfaces:
Wrapper
Wraps a fluid in a specific state of data.
There are no Bukkit or Paper API equivalents for this
wrapper.
FluidData is
tied to worlds.- Since:
- 3.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionamount()The amount of fluid held by this state, from1to8.static FluidState.Builderbuilder()Creates a new fluid state builder.static FluidStateReads a Minecraft fluid state into a wrapper.static FluidStateempty()The empty fluid state, holding no fluid.booleanfalling()Whether the fluid in this state is falling.static FluidStateCreates a non-falling flowing state of the given fluid.static FluidStateCreates a flowing state of the given fluid.fluid()The fluid this state belongs to.default booleanisEmpty()Whether this state holds no fluid at all.booleanisSource()Whether this state is a source block.default floatThe height of the fluid in this state within its own block, from0.0to1.0, matchingnet.minecraft.world.level.material.FluidState#getOwnHeight, which is defined asamount / 9f.static FluidStateCreates a source state of the given fluid.static FluidStateCreates a source state of the given fluid.default FluidState.BuilderConverts this fluid state into a builder.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
fluid
-
amount
-
isSource
Whether this state is a source block.- Returns:
- true if this state is a source block
- Since:
- 3.0.0
-
falling
-
isEmpty
Whether this state holds no fluid at all.- Returns:
- true if this state holds no fluid
- Since:
- 3.0.0
-
ownHeight
The height of the fluid in this state within its own block, from0.0to1.0, matchingnet.minecraft.world.level.material.FluidState#getOwnHeight, which is defined asamount / 9f.- Returns:
- the height of the fluid in this state within its own block
- Since:
- 3.0.0
-
source
Creates a source state of the given fluid.- Parameters:
fluid- the fluid- Returns:
- a source state of the given fluid
- Since:
- 3.0.0
-
source
Creates a source state of the given fluid.- Parameters:
fluid- the fluidfalling- whether the fluid is falling- Returns:
- a source state of the given fluid
- Since:
- 3.0.0
-
flowing
Creates a non-falling flowing state of the given fluid.- Parameters:
fluid- the fluidamount- the amount of fluid, from 1 to 8- Returns:
- a flowing state of the given fluid
- Since:
- 3.0.0
-
flowing
Creates a flowing state of the given fluid.- Parameters:
fluid- the fluidamount- the amount of fluid, from 1 to 8falling- whether the fluid is falling- Returns:
- a flowing state of the given fluid
- Since:
- 3.0.0
-
empty
The empty fluid state, holding no fluid.- Returns:
- the empty fluid state
- Since:
- 3.0.0
-
builder
Creates a new fluid state builder.- Returns:
- a new fluid state builder
- Since:
- 3.0.0
-
toBuilder
Converts this fluid state into a builder.- Returns:
- a builder containing the same data as this fluid state
- Since:
- 3.0.0
-
decode
Reads a Minecraft fluid state into a wrapper.- Parameters:
minecraftState- the Minecraft fluid state to read- Returns:
- the wrapper for the fluid state
- Since:
- 3.3.0
-