Inventory Util Upgrades.

This commit is contained in:
AlgorithmX2
2014-01-01 03:04:54 -06:00
parent d7337aeb6b
commit 978745238f
3 changed files with 57 additions and 2 deletions
+39
View File
@@ -0,0 +1,39 @@
package appeng.util.iterators;
import java.util.Iterator;
import appeng.api.storage.data.IAEItemStack;
import appeng.tile.inventory.AppEngInternalAEInventory;
public class AEInvIterator implements Iterator<IAEItemStack>
{
final AppEngInternalAEInventory inv;
final int size;
int x = 0;
public AEInvIterator(AppEngInternalAEInventory i) {
inv = i;
size = inv.getSizeInventory();
}
@Override
public boolean hasNext()
{
return x < size;
}
@Override
public IAEItemStack next()
{
return inv.getAEStackInSlot( x++ );
}
@Override
public void remove()
{
throw new RuntimeException( "no..." );
}
}