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 Summary
ConstructorDescriptionInventoryIterator
(net.minecraftforge.items.IItemHandlerModifiable inventory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
net.minecraft.world.item.ItemStack
next()
org.apache.commons.lang3.tuple.Pair<Integer,
net.minecraft.world.item.ItemStack> Get the next item indexed.void
remove()
void
replace
(net.minecraft.world.item.ItemStack itemStack) Replaces the itemstack on the position of the last returned itemstack.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
InventoryIterator
public InventoryIterator(net.minecraftforge.items.IItemHandlerModifiable inventory)
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
public net.minecraft.world.item.ItemStack next() -
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() -
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.
-