Class ForgeFluidHolder

java.lang.Object
earth.terrarium.botarium.forge.fluid.ForgeFluidHolder
All Implemented Interfaces:
FluidHolder

public class ForgeFluidHolder extends Object implements FluidHolder
  • Field Details

    • fluidStack

      protected net.minecraftforge.fluids.FluidStack fluidStack
  • Constructor Details

    • ForgeFluidHolder

      public ForgeFluidHolder(net.minecraftforge.fluids.FluidStack stack)
    • ForgeFluidHolder

      public ForgeFluidHolder(FluidHolder fluid)
    • 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:
      getFluid in interface FluidHolder
      Returns:
      The Fluid in the holder.
    • setFluid

      public void setFluid(net.minecraft.world.level.material.Fluid fluid)
      Description copied from interface: FluidHolder
      Sets the Fluid in the holder.
      Specified by:
      setFluid in interface FluidHolder
      Parameters:
      fluid - The Fluid to set in the holder.
    • getFluidAmount

      public long getFluidAmount()
      Specified by:
      getFluidAmount in interface FluidHolder
      Returns:
      The amount of fluid in the holder.
    • setAmount

      public void setAmount(long amount)
      Description copied from interface: FluidHolder
      Sets the amount of fluid in the holder.
      Specified by:
      setAmount in interface FluidHolder
      Parameters:
      amount - The amount of fluid to set in the holder.
    • getCompound

      public net.minecraft.nbt.CompoundTag getCompound()
      Specified by:
      getCompound in interface FluidHolder
      Returns:
      The CompoundTag in the holder.
    • setCompound

      public void setCompound(net.minecraft.nbt.CompoundTag tag)
      Description copied from interface: FluidHolder
      Sets the CompoundTag in the holder.
      Specified by:
      setCompound in interface FluidHolder
      Parameters:
      tag - The CompoundTag to set in the holder.
    • matches

      public boolean matches(FluidHolder fluidHolder)
      Description copied from interface: FluidHolder
      Compares the FluidHolder to another FluidHolder ignoring the amount.
      Specified by:
      matches in interface FluidHolder
      Parameters:
      fluidHolder - The FluidHolder to compare to.
      Returns:
      True if the given holder is equal to this holder, false otherwise.
    • copyHolder

      public FluidHolder copyHolder()
      Specified by:
      copyHolder in interface FluidHolder
      Returns:
      A copy of the FluidHolder.
    • serialize

      public net.minecraft.nbt.CompoundTag serialize()
      Specified by:
      serialize in interface FluidHolder
      Returns:
      A serialized version of the FluidHolder into a CompoundTag.
    • deserialize

      public void deserialize(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: FluidHolder
      Deserializes a FluidHolder from a given CompoundTag.
      Specified by:
      deserialize in interface FluidHolder
      Parameters:
      compound - The CompoundTag to deserialize from.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface FluidHolder
      Returns:
      True if the holder is empty, false otherwise.
    • toStack

      public static net.minecraftforge.fluids.FluidStack toStack(FluidHolder holder)
    • empty

      public static ForgeFluidHolder empty()
      Description copied from interface: FluidHolder
      Returns an empty FluidHolder.
      Returns:
      The empty FluidHolder.