Merge pull request #182 from thatsIch/While

Replaces while iterators with foreach call
This commit is contained in:
Chris
2014-09-29 14:10:03 -07:00
10 changed files with 33 additions and 36 deletions
@@ -89,15 +89,15 @@ public class CellInventory implements ICellInventory
// add new pretty stuff...
int x = 0;
Iterator<IAEItemStack> i = cellItems.iterator();
while (i.hasNext())
for (IAEItemStack v : cellItems)
{
IAEItemStack v = i.next();
itemCount += v.getStackSize();
NBTBase c = tagCompound.getTag( ITEM_SLOT_ARR[x] );
if ( c instanceof NBTTagCompound )
{
v.writeToNBT( (NBTTagCompound) c );
}
else
{
NBTTagCompound g = new NBTTagCompound();
@@ -155,12 +155,8 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
return input;
}
Iterator<List<IMEInventoryHandler<T>>> i = priorityInventory.values().iterator();// asMap().entrySet().iterator();
while (i.hasNext())
for (List<IMEInventoryHandler<T>> invList : priorityInventory.values())
{
List<IMEInventoryHandler<T>> invList = i.next();
Iterator<IMEInventoryHandler<T>> ii = invList.iterator();
while (ii.hasNext() && input != null)
{
@@ -168,7 +164,9 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
if ( inv.validForPass( 1 ) && inv.canAccept( input )
&& (inv.isPrioritized( input ) || inv.extractItems( input, Actionable.SIMULATE, src ) != null) )
{
input = inv.injectItems( input, type, src );
}
}
ii = invList.iterator();
@@ -176,7 +174,9 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
{
IMEInventoryHandler<T> inv = ii.next();
if ( inv.validForPass( 2 ) && inv.canAccept( input ) )// ignore crafting on the second pass.
{
input = inv.injectItems( input, type, src );
}
}
}