Interface FluidVariant
- All Superinterfaces:
TransferVariant<Fluid>
An immutable association of a still fluid and data components.
Do not extend this class. Use of(Fluid) and of(Fluid, ComponentChanges) to create instances.
FluidVariantRendering can be used for client-side rendering of fluid variants.
Fluid variants must always be compared with equals, never by reference!
hashCode is guaranteed to be correct and constant time independently of the size of the components.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FluidVariant> static final PacketCodec<RegistryByteBuf, FluidVariant> -
Method Summary
Modifier and TypeMethodDescriptionstatic FluidVariantblank()Retrieve a blank FluidVariant.default FluidgetFluid()Return the fluid of this variant.default RegistryEntry<Fluid> static FluidVariantRetrieve a FluidVariant with a fluid, and anulltag.static FluidVariantof(Fluid fluid, ComponentChanges components) Retrieve a FluidVariant with a fluid, and an optional tag.Methods inherited from interface net.fabricmc.fabric.api.transfer.v1.storage.TransferVariant
componentsMatch, getComponents, getObject, hasComponents, isBlank, isOf
-
Field Details
-
CODEC
-
PACKET_CODEC
-
-
Method Details
-
blank
Retrieve a blank FluidVariant. -
of
Retrieve a FluidVariant with a fluid, and anulltag.The flowing and still variations of flowable fluids are normalized to always refer to the still variant. For example,
FluidVariant.of(Fluids.FLOWING_WATER).getFluid() == Fluids.WATER. -
of
Retrieve a FluidVariant with a fluid, and an optional tag.The flowing and still variations of flowable fluids are normalized to always refer to the still fluid. For example,
FluidVariant.of(Fluids.FLOWING_WATER, ComponentChanges.EMPTY).getFluid() == Fluids.WATER. -
getFluid
Return the fluid of this variant. -
getRegistryEntry
-