Record Class SidedItemHandler
java.lang.Object
java.lang.Record
com.portingdeadmods.portingdeadlibs.api.capabilities.SidedItemHandler
- All Implemented Interfaces:
net.neoforged.neoforge.items.IItemHandler
-
Constructor Summary
ConstructorsConstructorDescriptionSidedItemHandler(net.neoforged.neoforge.items.IItemHandler innerHandler, IOAction action, it.unimi.dsi.fastutil.ints.IntList slots) Creates an instance of aSidedItemHandlerrecord class.SidedItemHandler(net.neoforged.neoforge.items.IItemHandler innerHandler, it.unimi.dsi.fastutil.Pair<IOAction, int[]> actionSlotsPair) -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull net.minecraft.world.item.ItemStackextractItem(int slot, int amount, boolean simulate) intgetSlotLimit(int i) intgetSlots()@NotNull net.minecraft.world.item.ItemStackgetStackInSlot(int i) final inthashCode()Returns a hash code value for this object.net.neoforged.neoforge.items.IItemHandlerReturns the value of theinnerHandlerrecord component.@NotNull net.minecraft.world.item.ItemStackinsertItem(int slot, @NotNull net.minecraft.world.item.ItemStack itemStack, boolean simulate) booleanisItemValid(int slot, @NotNull net.minecraft.world.item.ItemStack itemStack) it.unimi.dsi.fastutil.ints.IntListslots()Returns the value of theslotsrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aSidedItemHandlerrecord class.- Parameters:
innerHandler- the value for theinnerHandlerrecord componentaction- the value for theactionrecord componentslots- the value for theslotsrecord component
-
-
Method Details
-
getSlots
public int getSlots()- Specified by:
getSlotsin interfacenet.neoforged.neoforge.items.IItemHandler
-
getStackInSlot
@NotNull public @NotNull net.minecraft.world.item.ItemStack getStackInSlot(int i) - Specified by:
getStackInSlotin interfacenet.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:
insertItemin interfacenet.neoforged.neoforge.items.IItemHandler
-
extractItem
@NotNull public @NotNull net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate) - Specified by:
extractItemin interfacenet.neoforged.neoforge.items.IItemHandler
-
getSlotLimit
public int getSlotLimit(int i) - Specified by:
getSlotLimitin interfacenet.neoforged.neoforge.items.IItemHandler
-
isItemValid
public boolean isItemValid(int slot, @NotNull @NotNull net.minecraft.world.item.ItemStack itemStack) - Specified by:
isItemValidin interfacenet.neoforged.neoforge.items.IItemHandler
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
innerHandler
public net.neoforged.neoforge.items.IItemHandler innerHandler()Returns the value of theinnerHandlerrecord component.- Returns:
- the value of the
innerHandlerrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
slots
public it.unimi.dsi.fastutil.ints.IntList slots()Returns the value of theslotsrecord component.- Returns:
- the value of the
slotsrecord component
-