Class IndexedSlotlessItemHandlerWrapper
java.lang.Object
org.cyclops.commoncapabilities.api.capability.itemhandler.SlotlessItemHandlerWrapper
org.cyclops.cyclopscore.inventory.IndexedSlotlessItemHandlerWrapper
- All Implemented Interfaces:
ISlotlessItemHandler
A
ISlotlessItemHandler
that uses the index from a IndexedInventory.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic class -
Field Summary
Fields inherited from class org.cyclops.commoncapabilities.api.capability.itemhandler.SlotlessItemHandlerWrapper
itemHandler -
Constructor Summary
ConstructorsConstructorDescriptionIndexedSlotlessItemHandlerWrapper(net.neoforged.neoforge.items.IItemHandler itemHandler, IndexedSlotlessItemHandlerWrapper.IInventoryIndexReference inventory) -
Method Summary
Modifier and TypeMethodDescriptionprotected PrimitiveIterator.OfIntprotected PrimitiveIterator.OfIntprotected PrimitiveIterator.OfIntgetNonEmptySlotsWithItemStack(net.minecraft.world.item.ItemStack itemStack, int matchFlags) Get the slots in which the given ItemStack is present according to the given match flags.protected PrimitiveIterator.OfIntgetNonFullSlotsWithItemStack(net.minecraft.world.item.ItemStack itemStack, int matchFlags) Get the slots in which the given ItemStack is present according to the given match flags.protected PrimitiveIterator.OfIntgetSlotsWithItemStack(net.minecraft.world.item.ItemStack itemStack, int matchFlags) Get an iterator over all slots in which the given ItemStack is present according to the given match flags.static IntStreamMethods inherited from class org.cyclops.commoncapabilities.api.capability.itemhandler.SlotlessItemHandlerWrapper
extractItem, extractItem, findItems, getItems, getLimit, insertItem
-
Constructor Details
-
IndexedSlotlessItemHandlerWrapper
public IndexedSlotlessItemHandlerWrapper(net.neoforged.neoforge.items.IItemHandler itemHandler, IndexedSlotlessItemHandlerWrapper.IInventoryIndexReference inventory)
-
-
Method Details
-
getNonFullSlotsWithItemStack
protected PrimitiveIterator.OfInt getNonFullSlotsWithItemStack(@Nonnull net.minecraft.world.item.ItemStack itemStack, int matchFlags) Description copied from class:SlotlessItemHandlerWrapperGet the slots in which the given ItemStack is present according to the given match flags. Stacksize of the item in the slot must be below the maximum stack size, so there must be room left in the slot.- Specified by:
getNonFullSlotsWithItemStackin classSlotlessItemHandlerWrapper- Parameters:
itemStack- The ItemStack to look for.matchFlags- The flags to match the given ItemStack by.- Returns:
- The slots in which the ItemStack are present.
-
getNonEmptySlotsWithItemStack
protected PrimitiveIterator.OfInt getNonEmptySlotsWithItemStack(@Nonnull net.minecraft.world.item.ItemStack itemStack, int matchFlags) Description copied from class:SlotlessItemHandlerWrapperGet the slots in which the given ItemStack is present according to the given match flags. Stacksize of the item in the slot must be larger than zero.- Specified by:
getNonEmptySlotsWithItemStackin classSlotlessItemHandlerWrapper- Parameters:
itemStack- The ItemStack to look for.matchFlags- The flags to match the given ItemStack by.- Returns:
- The slots in which the ItemStack are present.
-
getSlotsWithItemStack
protected PrimitiveIterator.OfInt getSlotsWithItemStack(@Nonnull net.minecraft.world.item.ItemStack itemStack, int matchFlags) Description copied from class:SlotlessItemHandlerWrapperGet an iterator over all slots in which the given ItemStack is present according to the given match flags. Stacksize of the item in the slot must be larger than zero.- Specified by:
getSlotsWithItemStackin classSlotlessItemHandlerWrapper- Parameters:
itemStack- The ItemStack to look for.matchFlags- The flags to match the given ItemStack by.- Returns:
- An iterator over all slots in which the ItemStack is present.
-
getEmptySlots
- Specified by:
getEmptySlotsin classSlotlessItemHandlerWrapper- Returns:
- The slots with no ItemStack.
-
getNonEmptySlots
- Specified by:
getNonEmptySlotsin classSlotlessItemHandlerWrapper- Returns:
- The slots that are not empty.
-
intIteratorToStream
-