Class ForgeFluidHolder
java.lang.Object
earth.terrarium.botarium.forge.fluid.ForgeFluidHolder
- All Implemented Interfaces:
FluidHolder
-
Field Summary
FieldsFields inherited from interface earth.terrarium.botarium.common.fluid.base.FluidHolder
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionForgeFluidHolder(FluidHolder fluid) ForgeFluidHolder(net.minecraft.world.level.material.Fluid fluid, int amount, net.minecraft.nbt.CompoundTag tag) ForgeFluidHolder(net.minecraftforge.fluids.FluidStack stack) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(net.minecraft.nbt.CompoundTag compound) Deserializes aFluidHolderfrom a givenCompoundTag.static ForgeFluidHolderempty()Returns an empty FluidHolder.net.minecraft.nbt.CompoundTagnet.minecraft.world.level.material.FluidgetFluid()longnet.minecraftforge.fluids.FluidStackbooleanisEmpty()booleanmatches(FluidHolder fluidHolder) Compares theFluidHolderto anotherFluidHolderignoring the amount.net.minecraft.nbt.CompoundTagvoidsetAmount(long amount) Sets the amount of fluid in the holder.voidsetCompound(net.minecraft.nbt.CompoundTag tag) Sets theCompoundTagin the holder.voidsetFluid(net.minecraft.world.level.material.Fluid fluid) Sets theFluidin the holder.static net.minecraftforge.fluids.FluidStacktoStack(FluidHolder holder) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface earth.terrarium.botarium.common.fluid.base.FluidHolder
copyWithAmount, getFluidHolder, is, is, is, is, writeToBuffer
-
Field Details
-
fluidStack
protected net.minecraftforge.fluids.FluidStack fluidStack
-
-
Constructor Details
-
ForgeFluidHolder
public ForgeFluidHolder(net.minecraftforge.fluids.FluidStack stack) -
ForgeFluidHolder
-
ForgeFluidHolder
public ForgeFluidHolder(net.minecraft.world.level.material.Fluid fluid, int amount, net.minecraft.nbt.CompoundTag tag)
-
-
Method Details
-
getFluidStack
public net.minecraftforge.fluids.FluidStack getFluidStack() -
getFluid
public net.minecraft.world.level.material.Fluid getFluid()- Specified by:
getFluidin interfaceFluidHolder- Returns:
- The
Fluidin the holder.
-
setFluid
public void setFluid(net.minecraft.world.level.material.Fluid fluid) Description copied from interface:FluidHolderSets theFluidin the holder.- Specified by:
setFluidin interfaceFluidHolder- Parameters:
fluid- TheFluidto set in the holder.
-
getFluidAmount
public long getFluidAmount()- Specified by:
getFluidAmountin interfaceFluidHolder- Returns:
- The amount of fluid in the holder.
-
setAmount
public void setAmount(long amount) Description copied from interface:FluidHolderSets the amount of fluid in the holder.- Specified by:
setAmountin interfaceFluidHolder- Parameters:
amount- The amount of fluid to set in the holder.
-
getCompound
public net.minecraft.nbt.CompoundTag getCompound()- Specified by:
getCompoundin interfaceFluidHolder- Returns:
- The
CompoundTagin the holder.
-
setCompound
public void setCompound(net.minecraft.nbt.CompoundTag tag) Description copied from interface:FluidHolderSets theCompoundTagin the holder.- Specified by:
setCompoundin interfaceFluidHolder- Parameters:
tag- TheCompoundTagto set in the holder.
-
matches
Description copied from interface:FluidHolderCompares theFluidHolderto anotherFluidHolderignoring the amount.- Specified by:
matchesin interfaceFluidHolder- Parameters:
fluidHolder- TheFluidHolderto compare to.- Returns:
- True if the given holder is equal to this holder, false otherwise.
-
copyHolder
- Specified by:
copyHolderin interfaceFluidHolder- Returns:
- A copy of the
FluidHolder.
-
serialize
public net.minecraft.nbt.CompoundTag serialize()- Specified by:
serializein interfaceFluidHolder- Returns:
- A serialized version of the
FluidHolderinto aCompoundTag.
-
deserialize
public void deserialize(net.minecraft.nbt.CompoundTag compound) Description copied from interface:FluidHolderDeserializes aFluidHolderfrom a givenCompoundTag.- Specified by:
deserializein interfaceFluidHolder- Parameters:
compound- TheCompoundTagto deserialize from.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceFluidHolder- Returns:
- True if the holder is empty, false otherwise.
-
toStack
-
empty
Description copied from interface:FluidHolderReturns an empty FluidHolder.- Returns:
- The empty FluidHolder.
-