Record Class ForgeFluidContainer.ForgeFluidHandler<T extends FluidContainer & Updatable>

java.lang.Object
java.lang.Record
earth.terrarium.botarium.forge.fluid.ForgeFluidContainer.ForgeFluidHandler<T>
All Implemented Interfaces:
AutoSerializable, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.fluids.capability.IFluidHandler
Enclosing class:
ForgeFluidContainer

public static record ForgeFluidContainer.ForgeFluidHandler<T extends FluidContainer & Updatable>(T extends FluidContainer & Updatable container) extends Record implements net.minecraftforge.fluids.capability.IFluidHandler, AutoSerializable
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraftforge.fluids.capability.IFluidHandler

    net.minecraftforge.fluids.capability.IFluidHandler.FluidAction
  • Constructor Summary

    Constructors
    Constructor
    Description
    ForgeFluidHandler(T container)
    Creates an instance of a ForgeFluidHandler record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the container record component.
    @NotNull net.minecraftforge.fluids.FluidStack
    drain(int i, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction fluidAction)
     
    @NotNull net.minecraftforge.fluids.FluidStack
    drain(net.minecraftforge.fluids.FluidStack fluidStack, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction fluidAction)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    fill(net.minecraftforge.fluids.FluidStack fluidStack, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction fluidAction)
     
    @NotNull net.minecraftforge.fluids.FluidStack
     
     
    int
     
    int
     
    final int
    Returns a hash code value for this object.
    boolean
    isFluidValid(int i, @NotNull net.minecraftforge.fluids.FluidStack fluidStack)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface earth.terrarium.botarium.forge.AutoSerializable

    deserializeNBT, serializeNBT
  • Constructor Details

    • ForgeFluidHandler

      public ForgeFluidHandler(T container)
      Creates an instance of a ForgeFluidHandler record class.
      Parameters:
      container - the value for the container record component
  • Method Details

    • getTanks

      public int getTanks()
      Specified by:
      getTanks in interface net.minecraftforge.fluids.capability.IFluidHandler
    • getFluidInTank

      @NotNull public @NotNull net.minecraftforge.fluids.FluidStack getFluidInTank(int i)
      Specified by:
      getFluidInTank in interface net.minecraftforge.fluids.capability.IFluidHandler
    • getTankCapacity

      public int getTankCapacity(int i)
      Specified by:
      getTankCapacity in interface net.minecraftforge.fluids.capability.IFluidHandler
    • isFluidValid

      public boolean isFluidValid(int i, @NotNull @NotNull net.minecraftforge.fluids.FluidStack fluidStack)
      Specified by:
      isFluidValid in interface net.minecraftforge.fluids.capability.IFluidHandler
    • fill

      public int fill(net.minecraftforge.fluids.FluidStack fluidStack, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction fluidAction)
      Specified by:
      fill in interface net.minecraftforge.fluids.capability.IFluidHandler
    • drain

      @NotNull public @NotNull net.minecraftforge.fluids.FluidStack drain(net.minecraftforge.fluids.FluidStack fluidStack, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction fluidAction)
      Specified by:
      drain in interface net.minecraftforge.fluids.capability.IFluidHandler
    • drain

      @NotNull public @NotNull net.minecraftforge.fluids.FluidStack drain(int i, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction fluidAction)
      Specified by:
      drain in interface net.minecraftforge.fluids.capability.IFluidHandler
    • getSerializable

      public Serializable getSerializable()
      Specified by:
      getSerializable in interface AutoSerializable
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • container

      public T container()
      Returns the value of the container record component.
      Returns:
      the value of the container record component