Interface FluidVariant
- All Superinterfaces:
TransferVariant<net.minecraft.fluid.Fluid>
@Experimental
@Deprecated
@NonExtendable
public interface FluidVariant
extends TransferVariant<net.minecraft.fluid.Fluid>
Deprecated.
Experimental feature, we reserve the right to remove or change it without further notice.
The transfer API is a complex addition, and we want to be able to correct possible design mistakes.
An immutable association of a still fluid and an optional NBT tag.
Do not extend this class. Use of(Fluid)
and of(Fluid, NbtCompound)
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 NBT.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FluidVariant
blank()
Deprecated.Retrieve a blank FluidVariant.static FluidVariant
fromNbt(net.minecraft.nbt.NbtCompound nbt)
Deprecated.Deserialize a variant from an NBT compound tag, assuming it was serialized usingTransferVariant.toNbt()
.static FluidVariant
fromPacket(net.minecraft.network.PacketByteBuf buf)
Deprecated.Read a variant from a packet byte buffer, assuming it was serialized usingTransferVariant.toPacket(net.minecraft.network.PacketByteBuf)
.default net.minecraft.fluid.Fluid
getFluid()
Deprecated.Return the fluid of this variant.static FluidVariant
of(net.minecraft.fluid.Fluid fluid)
Deprecated.Retrieve a FluidVariant with a fluid, and anull
tag.static FluidVariant
of(net.minecraft.fluid.Fluid fluid, @Nullable net.minecraft.nbt.NbtCompound nbt)
Deprecated.Retrieve a FluidVariant with a fluid, and an optional tag.Methods inherited from interface net.fabricmc.fabric.api.transfer.v1.storage.TransferVariant
copyNbt, getNbt, getObject, hasNbt, isBlank, isOf, nbtMatches, toNbt, toPacket
-
Method Details
-
blank
Deprecated.Retrieve a blank FluidVariant. -
of
Deprecated.Retrieve a FluidVariant with a fluid, and anull
tag. -
of
static FluidVariant of(net.minecraft.fluid.Fluid fluid, @Nullable @Nullable net.minecraft.nbt.NbtCompound nbt)Deprecated.Retrieve a FluidVariant with a fluid, and an optional tag. -
getFluid
default net.minecraft.fluid.Fluid getFluid()Deprecated.Return the fluid of this variant. -
fromNbt
Deprecated.Deserialize a variant from an NBT compound tag, assuming it was serialized usingTransferVariant.toNbt()
.If an error occurs during deserialization, it will be logged with the DEBUG level, and a blank variant will be returned.
-
fromPacket
Deprecated.Read a variant from a packet byte buffer, assuming it was serialized usingTransferVariant.toPacket(net.minecraft.network.PacketByteBuf)
.
-