Class InventoryIterator

java.lang.Object
org.cyclops.cyclopscore.inventory.InventoryIterator
All Implemented Interfaces:
Iterator<net.minecraft.world.item.ItemStack>
Direct Known Subclasses:
PlayerInventoryIterator

public class InventoryIterator extends Object implements Iterator<net.minecraft.world.item.ItemStack>
Iterate over an inventory.
  • Constructor Details

    • InventoryIterator

      public InventoryIterator(net.minecraftforge.items.IItemHandlerModifiable inventory)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<net.minecraft.world.item.ItemStack>
    • next

      public net.minecraft.world.item.ItemStack next()
      Specified by:
      next in interface Iterator<net.minecraft.world.item.ItemStack>
    • nextIndexed

      public org.apache.commons.lang3.tuple.Pair<Integer,net.minecraft.world.item.ItemStack> nextIndexed()
      Get the next item indexed.
      Returns:
      The indexed item.
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<net.minecraft.world.item.ItemStack>
    • replace

      public void replace(net.minecraft.world.item.ItemStack itemStack)
      Replaces the itemstack on the position of the last returned itemstack.
      Parameters:
      itemStack - The itemstack to place.