Record Class SidedFluidHandler

java.lang.Object
java.lang.Record
com.portingdeadmods.portingdeadlibs.api.capabilities.SidedFluidHandler
All Implemented Interfaces:
net.neoforged.neoforge.fluids.capability.IFluidHandler

public record SidedFluidHandler(net.neoforged.neoforge.fluids.capability.IFluidHandler innerHandler, IOAction action, it.unimi.dsi.fastutil.ints.IntList tanks) extends Record implements net.neoforged.neoforge.fluids.capability.IFluidHandler
  • Nested Class Summary

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

    net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction
  • Constructor Summary

    Constructors
    Constructor
    Description
    SidedFluidHandler(net.neoforged.neoforge.fluids.capability.IFluidHandler innerHandler, IOAction action, it.unimi.dsi.fastutil.ints.IntList tanks)
    Creates an instance of a SidedFluidHandler record class.
    SidedFluidHandler(net.neoforged.neoforge.fluids.capability.IFluidHandler innerHandler, it.unimi.dsi.fastutil.Pair<IOAction,int[]> actionSlotsPair)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the action record component.
    @NotNull net.neoforged.neoforge.fluids.FluidStack
    drain(int maxDrain, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction fAction)
     
    @NotNull net.neoforged.neoforge.fluids.FluidStack
    drain(net.neoforged.neoforge.fluids.FluidStack resource, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction fAction)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    fill(net.neoforged.neoforge.fluids.FluidStack resource, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction fAction)
     
    @NotNull net.neoforged.neoforge.fluids.FluidStack
    getFluidInTank(int tank)
     
    int
    getTankCapacity(int tank)
     
    int
     
    final int
    Returns a hash code value for this object.
    net.neoforged.neoforge.fluids.capability.IFluidHandler
    Returns the value of the innerHandler record component.
    boolean
    isFluidValid(int tank, @NotNull net.neoforged.neoforge.fluids.FluidStack stack)
     
    it.unimi.dsi.fastutil.ints.IntList
    Returns the value of the tanks record component.
    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
  • Constructor Details

    • SidedFluidHandler

      public SidedFluidHandler(net.neoforged.neoforge.fluids.capability.IFluidHandler innerHandler, it.unimi.dsi.fastutil.Pair<IOAction,int[]> actionSlotsPair)
    • SidedFluidHandler

      public SidedFluidHandler(net.neoforged.neoforge.fluids.capability.IFluidHandler innerHandler, IOAction action, it.unimi.dsi.fastutil.ints.IntList tanks)
      Creates an instance of a SidedFluidHandler record class.
      Parameters:
      innerHandler - the value for the innerHandler record component
      action - the value for the action record component
      tanks - the value for the tanks record component
  • Method Details

    • getTanks

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

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

      public int getTankCapacity(int tank)
      Specified by:
      getTankCapacity in interface net.neoforged.neoforge.fluids.capability.IFluidHandler
    • isFluidValid

      public boolean isFluidValid(int tank, @NotNull @NotNull net.neoforged.neoforge.fluids.FluidStack stack)
      Specified by:
      isFluidValid in interface net.neoforged.neoforge.fluids.capability.IFluidHandler
    • fill

      public int fill(net.neoforged.neoforge.fluids.FluidStack resource, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction fAction)
      Specified by:
      fill in interface net.neoforged.neoforge.fluids.capability.IFluidHandler
    • drain

      @NotNull public @NotNull net.neoforged.neoforge.fluids.FluidStack drain(net.neoforged.neoforge.fluids.FluidStack resource, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction fAction)
      Specified by:
      drain in interface net.neoforged.neoforge.fluids.capability.IFluidHandler
    • drain

      @NotNull public @NotNull net.neoforged.neoforge.fluids.FluidStack drain(int maxDrain, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction fAction)
      Specified by:
      drain in interface net.neoforged.neoforge.fluids.capability.IFluidHandler
    • 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.
    • innerHandler

      public net.neoforged.neoforge.fluids.capability.IFluidHandler innerHandler()
      Returns the value of the innerHandler record component.
      Returns:
      the value of the innerHandler record component
    • action

      public IOAction action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component
    • tanks

      public it.unimi.dsi.fastutil.ints.IntList tanks()
      Returns the value of the tanks record component.
      Returns:
      the value of the tanks record component