final variables and parameters

seeing some methods it does actually help to enforce the parameters
This commit is contained in:
thatsIch
2015-09-25 23:10:56 +02:00
parent e52400bf26
commit 410d2f1e0d
819 changed files with 9390 additions and 9396 deletions
+29 -29
View File
@@ -80,7 +80,7 @@ public class TickHandler
return this.cliPlayerColors;
}
public void addCallable( World w, IWorldCallable<?> c )
public void addCallable( final World w, final IWorldCallable<?> c )
{
if( w == null )
{
@@ -100,7 +100,7 @@ public class TickHandler
}
}
public void addInit( AEBaseTile tile )
public void addInit( final AEBaseTile tile )
{
if( Platform.isServer() ) // for no there is no reason to care about this on the client...
{
@@ -117,7 +117,7 @@ public class TickHandler
return this.client;
}
public void addNetwork( Grid grid )
public void addNetwork( final Grid grid )
{
if( Platform.isServer() ) // for no there is no reason to care about this on the client...
{
@@ -125,7 +125,7 @@ public class TickHandler
}
}
public void removeNetwork( Grid grid )
public void removeNetwork( final Grid grid )
{
if( Platform.isServer() ) // for no there is no reason to care about this on the client...
{
@@ -144,15 +144,15 @@ public class TickHandler
}
@SubscribeEvent
public void unloadWorld( WorldEvent.Unload ev )
public void unloadWorld( final WorldEvent.Unload ev )
{
if( Platform.isServer() ) // for no there is no reason to care about this on the client...
{
LinkedList<IGridNode> toDestroy = new LinkedList<IGridNode>();
final LinkedList<IGridNode> toDestroy = new LinkedList<IGridNode>();
for( Grid g : this.getRepo().networks )
for( final Grid g : this.getRepo().networks )
{
for( IGridNode n : g.getNodes() )
for( final IGridNode n : g.getNodes() )
{
if( n.getWorld() == ev.world )
{
@@ -161,7 +161,7 @@ public class TickHandler
}
}
for( IGridNode n : toDestroy )
for( final IGridNode n : toDestroy )
{
n.destroy();
}
@@ -169,9 +169,9 @@ public class TickHandler
}
@SubscribeEvent
public void onChunkLoad( ChunkEvent.Load load )
public void onChunkLoad( final ChunkEvent.Load load )
{
for( Object te : load.getChunk().chunkTileEntityMap.values() )
for( final Object te : load.getChunk().chunkTileEntityMap.values() )
{
if( te instanceof AEBaseTile )
{
@@ -181,14 +181,14 @@ public class TickHandler
}
@SubscribeEvent
public void onTick( TickEvent ev )
public void onTick( final TickEvent ev )
{
if( ev.type == Type.CLIENT && ev.phase == Phase.START )
{
this.tickColors( this.cliPlayerColors );
EntityFloatingItem.ageStatic = ( EntityFloatingItem.ageStatic + 1 ) % 60000;
CableRenderMode currentMode = AEApi.instance().partHelper().getCableRenderMode();
final CableRenderMode currentMode = AEApi.instance().partHelper().getCableRenderMode();
if( currentMode != this.crm )
{
this.crm = currentMode;
@@ -198,17 +198,17 @@ public class TickHandler
if( ev.type == Type.WORLD && ev.phase == Phase.END )
{
WorldTickEvent wte = (WorldTickEvent) ev;
final WorldTickEvent wte = (WorldTickEvent) ev;
synchronized( this.craftingJobs )
{
Collection<CraftingJob> jobSet = this.craftingJobs.get( wte.world );
final Collection<CraftingJob> jobSet = this.craftingJobs.get( wte.world );
if( !jobSet.isEmpty() )
{
int simTime = Math.max( 1, AEConfig.instance.craftingCalculationTimePerTick / jobSet.size() );
Iterator<CraftingJob> i = jobSet.iterator();
final int simTime = Math.max( 1, AEConfig.instance.craftingCalculationTimePerTick / jobSet.size() );
final Iterator<CraftingJob> i = jobSet.iterator();
while( i.hasNext() )
{
CraftingJob cj = i.next();
final CraftingJob cj = i.next();
if( !cj.simulateFor( simTime ) )
{
i.remove();
@@ -223,10 +223,10 @@ public class TickHandler
{
this.tickColors( this.srvPlayerColors );
// ready tiles.
HandlerRep repo = this.getRepo();
final HandlerRep repo = this.getRepo();
while( !repo.tiles.isEmpty() )
{
AEBaseTile bt = repo.tiles.poll();
final AEBaseTile bt = repo.tiles.poll();
if( !bt.isInvalid() )
{
bt.onReady();
@@ -234,7 +234,7 @@ public class TickHandler
}
// tick networks.
for( Grid g : this.getRepo().networks )
for( final Grid g : this.getRepo().networks )
{
g.update();
}
@@ -252,12 +252,12 @@ public class TickHandler
}
}
private void tickColors( HashMap<Integer, PlayerColor> playerSet )
private void tickColors( final HashMap<Integer, PlayerColor> playerSet )
{
Iterator<PlayerColor> i = playerSet.values().iterator();
final Iterator<PlayerColor> i = playerSet.values().iterator();
while( i.hasNext() )
{
PlayerColor pc = i.next();
final PlayerColor pc = i.next();
if( pc.ticksLeft <= 0 )
{
i.remove();
@@ -266,14 +266,14 @@ public class TickHandler
}
}
private void processQueue( Queue<IWorldCallable<?>> queue, World world )
private void processQueue( final Queue<IWorldCallable<?>> queue, final World world )
{
if( queue == null )
{
return;
}
Stopwatch sw = Stopwatch.createStarted();
final Stopwatch sw = Stopwatch.createStarted();
IWorldCallable<?> c = null;
while( ( c = queue.poll() ) != null )
@@ -287,7 +287,7 @@ public class TickHandler
break;
}
}
catch( Exception e )
catch( final Exception e )
{
AELog.error( e );
}
@@ -298,7 +298,7 @@ public class TickHandler
// AELog.info( "processQueue Time: " + time + "ms" );
}
public void registerCraftingSimulation( World world, CraftingJob craftingJob )
public void registerCraftingSimulation( final World world, final CraftingJob craftingJob )
{
synchronized( this.craftingJobs )
{
@@ -327,7 +327,7 @@ public class TickHandler
protected final int myEntity;
protected int ticksLeft;
public PlayerColor( int id, AEColor col, int ticks )
public PlayerColor( final int id, final AEColor col, final int ticks )
{
this.myEntity = id;
this.myColor = col;