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
Modifier and TypeClassDescriptionstatic interface
static class
static class
-
Field Summary
Fields inherited from class org.cyclops.commoncapabilities.api.capability.itemhandler.SlotlessItemHandlerWrapper
itemHandler
-
Constructor Summary
ConstructorDescriptionIndexedSlotlessItemHandlerWrapper
(net.minecraftforge.items.IItemHandler itemHandler, IndexedSlotlessItemHandlerWrapper.IInventoryIndexReference inventory) -
Method Summary
Modifier and TypeMethodDescriptionprotected PrimitiveIterator.OfInt
protected PrimitiveIterator.OfInt
protected PrimitiveIterator.OfInt
getNonEmptySlotsWithItemStack
(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.OfInt
getNonFullSlotsWithItemStack
(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.OfInt
getSlotsWithItemStack
(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 IntStream
Methods inherited from class org.cyclops.commoncapabilities.api.capability.itemhandler.SlotlessItemHandlerWrapper
extractItem, extractItem, findItems, getItems, getLimit, insertItem
-
Constructor Details
-
IndexedSlotlessItemHandlerWrapper
public IndexedSlotlessItemHandlerWrapper(net.minecraftforge.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:SlotlessItemHandlerWrapper
Get 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:
getNonFullSlotsWithItemStack
in 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:SlotlessItemHandlerWrapper
Get 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:
getNonEmptySlotsWithItemStack
in 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:SlotlessItemHandlerWrapper
Get 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:
getSlotsWithItemStack
in 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:
getEmptySlots
in classSlotlessItemHandlerWrapper
- Returns:
- The slots with no ItemStack.
-
getNonEmptySlots
- Specified by:
getNonEmptySlots
in classSlotlessItemHandlerWrapper
- Returns:
- The slots that are not empty.
-
intIteratorToStream
-