Record Class SidedItemHandler

java.lang.Object
java.lang.Record
com.portingdeadmods.portingdeadlibs.api.capabilities.SidedItemHandler
All Implemented Interfaces:
net.neoforged.neoforge.items.IItemHandler

public record SidedItemHandler(net.neoforged.neoforge.items.IItemHandler innerHandler, IOAction action, it.unimi.dsi.fastutil.ints.IntList slots) extends Record implements net.neoforged.neoforge.items.IItemHandler
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    Returns the value of the action record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull net.minecraft.world.item.ItemStack
    extractItem(int slot, int amount, boolean simulate)
     
    int
    getSlotLimit(int i)
     
    int
     
    @NotNull net.minecraft.world.item.ItemStack
     
    final int
    Returns a hash code value for this object.
    net.neoforged.neoforge.items.IItemHandler
    Returns the value of the innerHandler record component.
    @NotNull net.minecraft.world.item.ItemStack
    insertItem(int slot, @NotNull net.minecraft.world.item.ItemStack itemStack, boolean simulate)
     
    boolean
    isItemValid(int slot, @NotNull net.minecraft.world.item.ItemStack itemStack)
     
    it.unimi.dsi.fastutil.ints.IntList
    Returns the value of the slots 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

    • SidedItemHandler

      public SidedItemHandler(net.neoforged.neoforge.items.IItemHandler innerHandler, it.unimi.dsi.fastutil.Pair<IOAction,int[]> actionSlotsPair)
    • SidedItemHandler

      public SidedItemHandler(net.neoforged.neoforge.items.IItemHandler innerHandler, IOAction action, it.unimi.dsi.fastutil.ints.IntList slots)
      Creates an instance of a SidedItemHandler record class.
      Parameters:
      innerHandler - the value for the innerHandler record component
      action - the value for the action record component
      slots - the value for the slots record component
  • Method Details

    • getSlots

      public int getSlots()
      Specified by:
      getSlots in interface net.neoforged.neoforge.items.IItemHandler
    • getStackInSlot

      @NotNull public @NotNull net.minecraft.world.item.ItemStack getStackInSlot(int i)
      Specified by:
      getStackInSlot in interface net.neoforged.neoforge.items.IItemHandler
    • insertItem

      @NotNull public @NotNull net.minecraft.world.item.ItemStack insertItem(int slot, @NotNull @NotNull net.minecraft.world.item.ItemStack itemStack, boolean simulate)
      Specified by:
      insertItem in interface net.neoforged.neoforge.items.IItemHandler
    • extractItem

      @NotNull public @NotNull net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate)
      Specified by:
      extractItem in interface net.neoforged.neoforge.items.IItemHandler
    • getSlotLimit

      public int getSlotLimit(int i)
      Specified by:
      getSlotLimit in interface net.neoforged.neoforge.items.IItemHandler
    • isItemValid

      public boolean isItemValid(int slot, @NotNull @NotNull net.minecraft.world.item.ItemStack itemStack)
      Specified by:
      isItemValid in interface net.neoforged.neoforge.items.IItemHandler
    • 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.items.IItemHandler 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
    • slots

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