diff --git a/me/Grid.java b/me/Grid.java index 03a004aa0..f7fece6bd 100644 --- a/me/Grid.java +++ b/me/Grid.java @@ -64,7 +64,7 @@ public class Grid implements IGrid public void remove(GridNode gridNode) { for (IGridCache c : caches.values()) - c.removeNode( this, gridNode, gridNode.getMachine() ); + c.removeNode( gridNode, gridNode.getMachine() ); Collection nodes = Machines.get( gridNode.getMachineClass() ); if ( nodes != null ) @@ -143,7 +143,7 @@ public class Grid implements IGrid nodes.add( gridNode ); for (IGridCache c : caches.values()) - c.addNode( this, gridNode, gridNode.getMachine() ); + c.addNode( gridNode, gridNode.getMachine() ); gridNode.gridProxy.gridChanged(); // postEventTo( gridNode, networkChanged ); @@ -198,7 +198,7 @@ public class Grid implements IGrid { for (IGridCache gc : caches.values()) { - gc.onUpdateTick( this ); + gc.onUpdateTick(); } } diff --git a/me/GridCacheWrapper.java b/me/GridCacheWrapper.java index 1fecb6c1f..8a068b30e 100644 --- a/me/GridCacheWrapper.java +++ b/me/GridCacheWrapper.java @@ -1,6 +1,5 @@ package appeng.me; -import appeng.api.networking.IGrid; import appeng.api.networking.IGridCache; import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; @@ -18,21 +17,21 @@ public class GridCacheWrapper implements IGridCache } @Override - public void onUpdateTick(final IGrid grid) + public void onUpdateTick() { - myCache.onUpdateTick( grid ); + myCache.onUpdateTick(); } @Override - public void removeNode(final IGrid grid, final IGridNode gridNode, final IGridHost machine) + public void removeNode(final IGridNode gridNode, final IGridHost machine) { - myCache.removeNode( grid, gridNode, machine ); + myCache.removeNode( gridNode, machine ); } @Override - public void addNode(final IGrid grid, final IGridNode gridNode, final IGridHost machine) + public void addNode(final IGridNode gridNode, final IGridHost machine) { - myCache.addNode( grid, gridNode, machine ); + myCache.addNode( gridNode, machine ); } public String getName() diff --git a/me/cache/EnergyGridCache.java b/me/cache/EnergyGridCache.java index cfef0736e..bc9dd1f8e 100644 --- a/me/cache/EnergyGridCache.java +++ b/me/cache/EnergyGridCache.java @@ -44,8 +44,10 @@ public class EnergyGridCache implements IEnergyGrid double tickDrainPerTick = 0; double tickInjectionPerTick = 0; - // Double[] totalDrainPastTicks = new Double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; - // Double[] totalInjectionPastTicks = new Double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + // Double[] totalDrainPastTicks = new Double[] { 0.0, 0.0, 0.0, 0.0, 0.0, + // 0.0, 0.0, 0.0, 0.0, 0.0 }; + // Double[] totalInjectionPastTicks = new Double[] { 0.0, 0.0, 0.0, 0.0, + // 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; /** * power status @@ -194,7 +196,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public void addNode(IGrid grid, IGridNode node, IGridHost machine) + public void addNode(IGridNode node, IGridHost machine) { if ( machine instanceof IEnergyGridProvider ) gproviders.add( (IEnergyGridProvider) machine ); @@ -225,11 +227,11 @@ public class EnergyGridCache implements IEnergyGrid } } - grid.postEventTo( node, new MENetworkPowerStatusChange() ); + myGrid.postEventTo( node, new MENetworkPowerStatusChange() ); } @Override - public void removeNode(IGrid grid, IGridNode node, IGridHost machine) + public void removeNode(IGridNode node, IGridHost machine) { if ( machine instanceof IEnergyGridProvider ) gproviders.remove( machine ); @@ -257,7 +259,7 @@ public class EnergyGridCache implements IEnergyGrid } @Override - public void onUpdateTick(IGrid grid) + public void onUpdateTick() { avgDrainPerTick *= (AvgLength - 1) / AvgLength; avgInjectionPerTick *= (AvgLength - 1) / AvgLength; @@ -292,9 +294,9 @@ public class EnergyGridCache implements IEnergyGrid // update public status, this buffers power ups for 30 ticks. if ( hasPower && ticksSinceHasPowerChange > 30 ) - publicPowerState( true, grid ); + publicPowerState( true, myGrid ); else if ( !hasPower ) - publicPowerState( false, grid ); + publicPowerState( false, myGrid ); availableTicksSinceUpdate++; if ( extra > 32 ) @@ -433,7 +435,8 @@ public class EnergyGridCache implements IEnergyGrid return avgDrainPerTick;/* * double out = 0; * - * for (double x : totalDrainPastTicks) out += x; + * for (double x : totalDrainPastTicks) out += + * x; * * return out / totalDrainPastTicks.length; */ @@ -445,9 +448,11 @@ public class EnergyGridCache implements IEnergyGrid return avgInjectionPerTick;/* * double out = 0; * - * for (double x : totalInjectionPastTicks) out += x; + * for (double x : totalInjectionPastTicks) + * out += x; * - * return out / totalInjectionPastTicks.length; + * return out / + * totalInjectionPastTicks.length; */ } diff --git a/me/cache/GridStorageCache.java b/me/cache/GridStorageCache.java index 4e640278d..2269a7a5a 100644 --- a/me/cache/GridStorageCache.java +++ b/me/cache/GridStorageCache.java @@ -51,14 +51,14 @@ public class GridStorageCache implements IStorageGrid } @Override - public void onUpdateTick(IGrid grid) + public void onUpdateTick() { itemMonitor.onTick(); fluidMonitor.onTick(); } @Override - public void removeNode(IGrid grid, IGridNode node, IGridHost machine) + public void removeNode(IGridNode node, IGridHost machine) { if ( machine instanceof ICellContainer ) { @@ -90,7 +90,7 @@ public class GridStorageCache implements IStorageGrid } @Override - public void addNode(IGrid grid, IGridNode node, IGridHost machine) + public void addNode(IGridNode node, IGridHost machine) { if ( machine instanceof ICellContainer ) { diff --git a/me/cache/P2PCache.java b/me/cache/P2PCache.java index 2546ca261..d6fc29d89 100644 --- a/me/cache/P2PCache.java +++ b/me/cache/P2PCache.java @@ -55,7 +55,7 @@ public class P2PCache implements IGridCache } @Override - public void onUpdateTick(IGrid grid) + public void onUpdateTick() { } @@ -72,13 +72,14 @@ public class P2PCache implements IGridCache else inputs.put( t.freq, t ); - // AELog.info( "update-" + (t.output ? "output: " : "input: ") + t.freq ); + // AELog.info( "update-" + (t.output ? "output: " : "input: ") + t.freq + // ); updateTunnel( t.freq, t.output ); updateTunnel( t.freq, !t.output ); } @Override - public void addNode(IGrid grid, IGridNode node, IGridHost machine) + public void addNode(IGridNode node, IGridHost machine) { if ( machine instanceof PartP2PTunnel ) { @@ -89,7 +90,8 @@ public class P2PCache implements IGridCache } PartP2PTunnel t = (PartP2PTunnel) machine; - // AELog.info( "add-" + (t.output ? "output: " : "input: ") + t.freq ); + // AELog.info( "add-" + (t.output ? "output: " : "input: ") + t.freq + // ); if ( t.output ) outputs.put( t.freq, t ); @@ -101,7 +103,7 @@ public class P2PCache implements IGridCache } @Override - public void removeNode(IGrid grid, IGridNode node, IGridHost machine) + public void removeNode(IGridNode node, IGridHost machine) { if ( machine instanceof PartP2PTunnel ) { @@ -112,7 +114,8 @@ public class P2PCache implements IGridCache } PartP2PTunnel t = (PartP2PTunnel) machine; - // AELog.info( "rmv-" + (t.output ? "output: " : "input: ") + t.freq ); + // AELog.info( "rmv-" + (t.output ? "output: " : "input: ") + t.freq + // ); if ( t.output ) outputs.remove( t.freq, t ); diff --git a/me/cache/PathGridCache.java b/me/cache/PathGridCache.java index 554551c46..4316797e2 100644 --- a/me/cache/PathGridCache.java +++ b/me/cache/PathGridCache.java @@ -55,7 +55,7 @@ public class PathGridCache implements IPathingGrid } @Override - public void onUpdateTick(IGrid grid) + public void onUpdateTick() { if ( recalculateControllerNextTick ) { @@ -95,8 +95,9 @@ public class PathGridCache implements IPathingGrid closedList = new HashSet(); semiOpen = new HashSet(); - // myGrid.getPivot().beginVisition( new AdHocChannelUpdater( 0 ) ); - for (IGridNode node : grid.getMachines( TileController.class )) + // myGrid.getPivot().beginVisition( new AdHocChannelUpdater( 0 ) + // ); + for (IGridNode node : myGrid.getMachines( TileController.class )) { closedList.add( (IPathItem) node ); for (IGridConnection gcc : node.getConnections()) @@ -182,7 +183,7 @@ public class PathGridCache implements IPathingGrid } @Override - public void removeNode(IGrid grid, IGridNode gridNode, IGridHost machine) + public void removeNode(IGridNode gridNode, IGridHost machine) { if ( machine instanceof TileController ) { @@ -197,7 +198,7 @@ public class PathGridCache implements IPathingGrid } @Override - public void addNode(IGrid grid, IGridNode gridNode, IGridHost machine) + public void addNode(IGridNode gridNode, IGridHost machine) { if ( machine instanceof TileController ) { diff --git a/me/cache/SecurityCache.java b/me/cache/SecurityCache.java index 351149a2b..f8f97d5e9 100644 --- a/me/cache/SecurityCache.java +++ b/me/cache/SecurityCache.java @@ -97,7 +97,7 @@ public class SecurityCache implements IGridCache, ISecurityGrid } @Override - public void removeNode(IGrid grid, IGridNode gridNode, IGridHost machine) + public void removeNode(IGridNode gridNode, IGridHost machine) { if ( machine instanceof TileSecurity ) { @@ -107,7 +107,7 @@ public class SecurityCache implements IGridCache, ISecurityGrid } @Override - public void addNode(IGrid grid, IGridNode gridNode, IGridHost machine) + public void addNode(IGridNode gridNode, IGridHost machine) { if ( machine instanceof TileSecurity ) { @@ -119,7 +119,7 @@ public class SecurityCache implements IGridCache, ISecurityGrid } @Override - public void onUpdateTick(IGrid grid) + public void onUpdateTick() { } diff --git a/me/cache/SpatialPylonCache.java b/me/cache/SpatialPylonCache.java index 08955d772..001f122f1 100644 --- a/me/cache/SpatialPylonCache.java +++ b/me/cache/SpatialPylonCache.java @@ -182,18 +182,18 @@ public class SpatialPylonCache implements IGridCache, ISpatialCache } @Override - public void onUpdateTick(IGrid grid) + public void onUpdateTick() { } @Override - public void addNode(IGrid grid, IGridNode node, IGridHost machine) + public void addNode(IGridNode node, IGridHost machine) { } @Override - public void removeNode(IGrid grid, IGridNode node, IGridHost machine) + public void removeNode(IGridNode node, IGridHost machine) { } diff --git a/me/cache/TickManagerCache.java b/me/cache/TickManagerCache.java index 70731aa8e..e49e359cb 100644 --- a/me/cache/TickManagerCache.java +++ b/me/cache/TickManagerCache.java @@ -52,7 +52,7 @@ public class TickManagerCache implements ITickManager } @Override - public void onUpdateTick(IGrid grid) + public void onUpdateTick() { currentTick++; while (!upcomingTicks.isEmpty()) @@ -146,7 +146,7 @@ public class TickManagerCache implements ITickManager } @Override - public void removeNode(IGrid grid, IGridNode gridNode, IGridHost machine) + public void removeNode(IGridNode gridNode, IGridHost machine) { if ( machine instanceof IGridTickable ) { @@ -157,7 +157,7 @@ public class TickManagerCache implements ITickManager } @Override - public void addNode(IGrid grid, IGridNode gridNode, IGridHost machine) + public void addNode(IGridNode gridNode, IGridHost machine) { if ( machine instanceof IGridTickable ) {