Deleted unnecessary casts with Eclipse
This commit is contained in:
@@ -95,7 +95,7 @@ public class GridConnection implements IGridConnection, IPathItem
|
||||
|
||||
private boolean isNetworkABetter(GridNode a, GridNode b)
|
||||
{
|
||||
return ((Grid) a.myGrid).isImportant > ((Grid) b.myGrid).isImportant || a.myGrid.size() > b.myGrid.size();
|
||||
return a.myGrid.isImportant > b.myGrid.isImportant || a.myGrid.size() > b.myGrid.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -277,7 +277,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
|
||||
if ( con != null )
|
||||
{
|
||||
IGridNode os = (IGridNode) con.getOtherSide( this );
|
||||
IGridNode os = con.getOtherSide( this );
|
||||
if ( os == node )
|
||||
{
|
||||
// if this connection is no longer valid, destroy it.
|
||||
|
||||
+2
-2
@@ -233,7 +233,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
if ( machine instanceof ICraftingWatcherHost )
|
||||
{
|
||||
ICraftingWatcherHost swh = (ICraftingWatcherHost) machine;
|
||||
CraftingWatcher iw = new CraftingWatcher( this, (ICraftingWatcherHost) swh );
|
||||
CraftingWatcher iw = new CraftingWatcher( this, swh );
|
||||
watchers.put( gridNode, iw );
|
||||
swh.updateWatcher( iw );
|
||||
}
|
||||
@@ -420,7 +420,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
public boolean canAccept(IAEStack input)
|
||||
{
|
||||
for (CraftingCPUCluster cpu : cpuClusters)
|
||||
if ( cpu.canAccept( (IAEItemStack) input ) )
|
||||
if ( cpu.canAccept( input ) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -305,7 +305,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
if ( machine instanceof IEnergyWatcherHost )
|
||||
{
|
||||
IEnergyWatcherHost swh = (IEnergyWatcherHost) machine;
|
||||
EnergyWatcher iw = new EnergyWatcher( this, (IEnergyWatcherHost) swh );
|
||||
EnergyWatcher iw = new EnergyWatcher( this, swh );
|
||||
watchers.put( node, iw );
|
||||
swh.updateWatcher( iw );
|
||||
}
|
||||
|
||||
+3
-3
@@ -249,7 +249,7 @@ public class GridStorageCache implements IStorageGrid
|
||||
if ( machine instanceof IStackWatcherHost )
|
||||
{
|
||||
IStackWatcherHost swh = (IStackWatcherHost) machine;
|
||||
ItemWatcher iw = new ItemWatcher( this, (IStackWatcherHost) swh );
|
||||
ItemWatcher iw = new ItemWatcher( this, swh );
|
||||
watchers.put( node, iw );
|
||||
swh.updateWatcher( iw );
|
||||
}
|
||||
@@ -286,10 +286,10 @@ public class GridStorageCache implements IStorageGrid
|
||||
switch (chan)
|
||||
{
|
||||
case FLUIDS:
|
||||
fluidMonitor.postChange( up_or_down > 0, (IItemList<IAEFluidStack>) availableItems, src );
|
||||
fluidMonitor.postChange( up_or_down > 0, availableItems, src );
|
||||
break;
|
||||
case ITEMS:
|
||||
itemMonitor.postChange( up_or_down > 0, (IItemList<IAEItemStack>) availableItems, src );
|
||||
itemMonitor.postChange( up_or_down > 0, availableItems, src );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
+3
-3
@@ -94,7 +94,7 @@ public class PathGridCache implements IPathingGrid
|
||||
int nodes = myGrid.getNodes().size();
|
||||
ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 );
|
||||
channelsByBlocks = nodes * used;
|
||||
channelPowerUsage = (double) channelsByBlocks / 128.0;
|
||||
channelPowerUsage = channelsByBlocks / 128.0;
|
||||
|
||||
myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) );
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class PathGridCache implements IPathingGrid
|
||||
|
||||
ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 );
|
||||
channelsByBlocks = nodes * used;
|
||||
channelPowerUsage = (double) channelsByBlocks / 128.0;
|
||||
channelPowerUsage = channelsByBlocks / 128.0;
|
||||
|
||||
myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) );
|
||||
}
|
||||
@@ -177,7 +177,7 @@ public class PathGridCache implements IPathingGrid
|
||||
achievementPost();
|
||||
|
||||
booting = false;
|
||||
channelPowerUsage = (double) channelsByBlocks / 128.0;
|
||||
channelPowerUsage = channelsByBlocks / 128.0;
|
||||
myGrid.postEvent( new MENetworkBootingStatusChange() );
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ public class SecurityCache implements IGridCache, ISecurityGrid
|
||||
{
|
||||
if ( machine instanceof ISecurityProvider )
|
||||
{
|
||||
securityProvider.remove( (ISecurityProvider) machine );
|
||||
securityProvider.remove( machine );
|
||||
updateSecurityKey();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
if ( finalOutput.equals( what ) )
|
||||
{
|
||||
if ( myLastLink != null )
|
||||
return ((CraftingLink) myLastLink).injectItems( (IAEItemStack) what.copy(), type );
|
||||
return ((CraftingLink) myLastLink).injectItems( what.copy(), type );
|
||||
|
||||
return what; // ignore it.
|
||||
}
|
||||
@@ -331,7 +331,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
{
|
||||
if ( myLastLink != null )
|
||||
{
|
||||
leftOver.add( ((CraftingLink) myLastLink).injectItems( (IAEItemStack) used.copy(), type ) );
|
||||
leftOver.add( ((CraftingLink) myLastLink).injectItems( used.copy(), type ) );
|
||||
return leftOver;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
if ( myLastLink != null )
|
||||
{
|
||||
what.add( ((CraftingLink) myLastLink).injectItems( (IAEItemStack) insert.copy(), type ) );
|
||||
what.add( ((CraftingLink) myLastLink).injectItems( insert.copy(), type ) );
|
||||
return what;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class QuantumCalculator extends MBCalculator
|
||||
num++;
|
||||
if ( num == 5 )
|
||||
{
|
||||
flags = (byte) (num);
|
||||
flags = (num);
|
||||
c.setCenter( te );
|
||||
}
|
||||
else
|
||||
@@ -69,7 +69,7 @@ public class QuantumCalculator extends MBCalculator
|
||||
if ( num == 1 || num == 3 || num == 7 || num == 9 )
|
||||
flags = (byte) (tqb.corner | num);
|
||||
else
|
||||
flags = (byte) (num);
|
||||
flags = (num);
|
||||
c.Ring[ringNum++] = te;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
|
||||
if ( myOtherSide instanceof QuantumCluster )
|
||||
{
|
||||
QuantumCluster sideA = (QuantumCluster) this;
|
||||
QuantumCluster sideA = this;
|
||||
QuantumCluster sideB = (QuantumCluster) myOtherSide;
|
||||
|
||||
if ( sideA.isActive() && sideB.isActive() )
|
||||
|
||||
@@ -22,7 +22,7 @@ public class VoidFluidInventory implements IMEInventoryHandler<IAEFluidStack>
|
||||
public IAEFluidStack injectItems(IAEFluidStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( input != null )
|
||||
target.addPower( (double) input.getStackSize() / 1000.0 );
|
||||
target.addPower( input.getStackSize() / 1000.0 );
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user