Class IndexedSlotlessItemHandlerWrapper

java.lang.Object
org.cyclops.commoncapabilities.api.capability.itemhandler.SlotlessItemHandlerWrapper
org.cyclops.cyclopscore.inventory.IndexedSlotlessItemHandlerWrapper
All Implemented Interfaces:
ISlotlessItemHandler

public class IndexedSlotlessItemHandlerWrapper extends SlotlessItemHandlerWrapper
A ISlotlessItemHandler that uses the index from a IndexedInventory.
  • Constructor Details

  • 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 class SlotlessItemHandlerWrapper
      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 class SlotlessItemHandlerWrapper
      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 class SlotlessItemHandlerWrapper
      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

      protected PrimitiveIterator.OfInt getEmptySlots()
      Specified by:
      getEmptySlots in class SlotlessItemHandlerWrapper
      Returns:
      The slots with no ItemStack.
    • getNonEmptySlots

      protected PrimitiveIterator.OfInt getNonEmptySlots()
      Specified by:
      getNonEmptySlots in class SlotlessItemHandlerWrapper
      Returns:
      The slots that are not empty.
    • intIteratorToStream

      public static IntStream intIteratorToStream(PrimitiveIterator.OfInt it)