Replaced normal for loops with foreach loops which is less error prone when just iterating over collection/array

This commit is contained in:
thatsIch
2014-09-29 09:23:02 +02:00
parent 87126e1f11
commit 3db2d4960b
15 changed files with 86 additions and 60 deletions
@@ -89,22 +89,26 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
String with = GuiText.With.getLocal() + ": ";
boolean first = true;
for (int x = 0; x < out.length; x++)
for (IAEItemStack anOut : out)
{
if ( out[x] == null )
if ( anOut == null )
{
continue;
}
l.add( (first ? label : and) + out[x].getStackSize() + " " + Platform.getItemDisplayName( out[x] ) );
l.add( (first ? label : and) + anOut.getStackSize() + " " + Platform.getItemDisplayName( anOut ) );
first = false;
}
first = true;
for (int x = 0; x < in.length; x++)
for (IAEItemStack anIn : in)
{
if ( in[x] == null )
if ( anIn == null )
{
continue;
}
l.add( (first ? with : and) + in[x].getStackSize() + " " + Platform.getItemDisplayName( in[x] ) );
l.add( (first ? with : and) + anIn.getStackSize() + " " + Platform.getItemDisplayName( anIn ) );
first = false;
}
}