mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Java5 cleanup
- Replace for loops with foreach - Remove unnecessary boxing
This commit is contained in:
1 parent
6721909e84
commit
3db03edbc9
6 files changed
+50
-41
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user