Java5 cleanup

- Replace for loops with foreach
- Remove unnecessary boxing
This commit is contained in:
Tom Elfring committed 2017-08-05 14:06:36 +02:00
1 parent 6721909e84
commit 3db03edbc9
6 files changed
+50 -41

No files matched your search

+9 -11
View File
@@ -929,22 +929,20 @@ public class Mekanism
if(event.getChunk() != null && !event.getWorld().isRemote)
{
Map copy = (Map)((HashMap)event.getChunk().getTileEntityMap()).clone();
for(Iterator iter = copy.values().iterator(); iter.hasNext();)
for (Object obj : copy.values())
{
Object obj = iter.next();
if(obj instanceof TileEntity)
if (obj instanceof TileEntity)
{
TileEntity tileEntity = (TileEntity)obj;
if(tileEntity instanceof TileEntityElectricBlock && MekanismUtils.useIC2())
TileEntity tileEntity = (TileEntity) obj;
if (tileEntity instanceof TileEntityElectricBlock && MekanismUtils.useIC2())
{
((TileEntityElectricBlock)tileEntity).register();
((TileEntityElectricBlock) tileEntity).register();
}
else if(tileEntity instanceof IChunkLoadHandler)
else if (tileEntity instanceof IChunkLoadHandler)
{
((IChunkLoadHandler)tileEntity).onChunkLoad();
((IChunkLoadHandler) tileEntity).onChunkLoad();
}
}
}