final variables and parameters
This commit is contained in:
@@ -41,14 +41,14 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
|
||||
final TileCraftingTile tqb;
|
||||
|
||||
public CraftingCPUCalculator( IAEMultiBlock t )
|
||||
public CraftingCPUCalculator( final IAEMultiBlock t )
|
||||
{
|
||||
super( t );
|
||||
this.tqb = (TileCraftingTile) t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMultiblockScale( WorldCoord min, WorldCoord max )
|
||||
public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
if( max.x - min.x > 16 )
|
||||
{
|
||||
@@ -69,13 +69,13 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAECluster createCluster( World w, WorldCoord min, WorldCoord max )
|
||||
public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
return new CraftingCPUCluster( min, max );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max )
|
||||
public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
boolean storage = false;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
|
||||
if( !te.isValid() )
|
||||
{
|
||||
@@ -110,9 +110,9 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max )
|
||||
public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
CraftingCPUCluster c = (CraftingCPUCluster) cl;
|
||||
final CraftingCPUCluster c = (CraftingCPUCluster) cl;
|
||||
|
||||
for( int x = min.x; x <= max.x; x++ )
|
||||
{
|
||||
@@ -120,7 +120,7 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
TileCraftingTile te = (TileCraftingTile) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
final TileCraftingTile te = (TileCraftingTile) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
te.updateStatus( c );
|
||||
c.addTile( te );
|
||||
}
|
||||
@@ -129,14 +129,14 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
|
||||
c.done();
|
||||
|
||||
Iterator<IGridHost> i = c.getTiles();
|
||||
final Iterator<IGridHost> i = c.getTiles();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
IGridHost gh = i.next();
|
||||
IGridNode n = gh.getGridNode( AEPartLocation.INTERNAL );
|
||||
final IGridHost gh = i.next();
|
||||
final IGridNode n = gh.getGridNode( AEPartLocation.INTERNAL );
|
||||
if( n != null )
|
||||
{
|
||||
IGrid g = n.getGrid();
|
||||
final IGrid g = n.getGrid();
|
||||
if( g != null )
|
||||
{
|
||||
g.postEvent( new MENetworkCraftingCpuChange( n ) );
|
||||
@@ -147,7 +147,7 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidTile( TileEntity te )
|
||||
public boolean isValidTile( final TileEntity te )
|
||||
{
|
||||
return te instanceof TileCraftingTile;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
private long startItemCount;
|
||||
private long remainingItemCount;
|
||||
|
||||
public CraftingCPUCluster( WorldCoord min, WorldCoord max )
|
||||
public CraftingCPUCluster( final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
@@ -132,7 +132,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
* add a new Listener to the monitor, be sure to properly remove yourself when your done.
|
||||
*/
|
||||
@Override
|
||||
public void addListener( IMEMonitorHandlerReceiver<IAEItemStack> l, Object verificationToken )
|
||||
public void addListener( final IMEMonitorHandlerReceiver<IAEItemStack> l, final Object verificationToken )
|
||||
{
|
||||
this.listeners.put( l, verificationToken );
|
||||
}
|
||||
@@ -141,7 +141,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
* remove a Listener to the monitor.
|
||||
*/
|
||||
@Override
|
||||
public void removeListener( IMEMonitorHandlerReceiver<IAEItemStack> l )
|
||||
public void removeListener( final IMEMonitorHandlerReceiver<IAEItemStack> l )
|
||||
{
|
||||
this.listeners.remove( l );
|
||||
}
|
||||
@@ -152,9 +152,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus( boolean updateGrid )
|
||||
public void updateStatus( final boolean updateGrid )
|
||||
{
|
||||
for( TileCraftingTile r : this.tiles )
|
||||
for( final TileCraftingTile r : this.tiles )
|
||||
{
|
||||
r.updateMeta( true );
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
boolean posted = false;
|
||||
|
||||
for( TileCraftingTile r : this.tiles )
|
||||
for( final TileCraftingTile r : this.tiles )
|
||||
{
|
||||
final IGridNode n = r.getActionableNode();
|
||||
if( n != null && !posted )
|
||||
@@ -194,7 +194,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return (Iterator) this.tiles.iterator();
|
||||
}
|
||||
|
||||
public void addTile( TileCraftingTile te )
|
||||
public void addTile( final TileCraftingTile te )
|
||||
{
|
||||
if( this.machineSrc == null || te.isCoreBlock )
|
||||
{
|
||||
@@ -220,7 +220,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canAccept( IAEStack input )
|
||||
public boolean canAccept( final IAEStack input )
|
||||
{
|
||||
if( input instanceof IAEItemStack )
|
||||
{
|
||||
@@ -233,7 +233,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return false;
|
||||
}
|
||||
|
||||
public IAEStack injectItems( IAEStack input, Actionable type, BaseActionSource src )
|
||||
public IAEStack injectItems( final IAEStack input, final Actionable type, final BaseActionSource src )
|
||||
{
|
||||
if( !( input instanceof IAEItemStack ) )
|
||||
{
|
||||
@@ -362,7 +362,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return input;
|
||||
}
|
||||
|
||||
protected void postChange( IAEItemStack diff, BaseActionSource src )
|
||||
protected void postChange( final IAEItemStack diff, final BaseActionSource src )
|
||||
{
|
||||
final Iterator<Entry<IMEMonitorHandlerReceiver<IAEItemStack>, Object>> i = this.getListeners();
|
||||
|
||||
@@ -394,7 +394,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.getCore().markDirty();
|
||||
}
|
||||
|
||||
public void postCraftingStatusChange( IAEItemStack diff )
|
||||
public void postCraftingStatusChange( final IAEItemStack diff )
|
||||
{
|
||||
if( this.getGrid() == null )
|
||||
{
|
||||
@@ -409,7 +409,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
if( !list.isEmpty() )
|
||||
{
|
||||
for( CraftingWatcher iw : list )
|
||||
for( final CraftingWatcher iw : list )
|
||||
|
||||
{
|
||||
iw.getHost().onRequestChange( sg, diff );
|
||||
@@ -442,7 +442,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
send = null;
|
||||
}
|
||||
|
||||
for( TileCraftingMonitorTile t : this.status )
|
||||
for( final TileCraftingMonitorTile t : this.status )
|
||||
{
|
||||
t.setJob( send );
|
||||
}
|
||||
@@ -460,7 +460,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
public IGrid getGrid()
|
||||
{
|
||||
for( TileCraftingTile r : this.tiles )
|
||||
for( final TileCraftingTile r : this.tiles )
|
||||
{
|
||||
final IGridNode gn = r.getActionableNode();
|
||||
if( gn != null )
|
||||
@@ -476,7 +476,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean canCraft( ICraftingPatternDetails details, IAEItemStack[] condensedInputs )
|
||||
private boolean canCraft( final ICraftingPatternDetails details, final IAEItemStack[] condensedInputs )
|
||||
{
|
||||
for( IAEItemStack g : condensedInputs )
|
||||
{
|
||||
@@ -531,9 +531,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.myLastLink.cancel();
|
||||
}
|
||||
|
||||
IItemList<IAEItemStack> list;
|
||||
final IItemList<IAEItemStack> list;
|
||||
this.getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL );
|
||||
for( IAEItemStack is : list )
|
||||
for( final IAEItemStack is : list )
|
||||
{
|
||||
this.postChange( is, this.machineSrc );
|
||||
}
|
||||
@@ -546,7 +546,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
this.waitingFor.resetStatus();
|
||||
|
||||
for( IAEItemStack is : items )
|
||||
for( final IAEItemStack is : items )
|
||||
{
|
||||
this.postCraftingStatusChange( is );
|
||||
}
|
||||
@@ -557,7 +557,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.storeItems(); // marks dirty
|
||||
}
|
||||
|
||||
public void updateCraftingLogic( IGrid grid, IEnergyGrid eg, CraftingGridCache cc )
|
||||
public void updateCraftingLogic( final IGrid grid, final IEnergyGrid eg, final CraftingGridCache cc )
|
||||
{
|
||||
if( !this.getCore().isActive() )
|
||||
{
|
||||
@@ -612,7 +612,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
private void executeCrafting( IEnergyGrid eg, CraftingGridCache cc )
|
||||
private void executeCrafting( final IEnergyGrid eg, final CraftingGridCache cc )
|
||||
{
|
||||
final Iterator<Entry<ICraftingPatternDetails, TaskProgress>> i = this.tasks.entrySet().iterator();
|
||||
|
||||
@@ -632,7 +632,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
{
|
||||
InventoryCrafting ic = null;
|
||||
|
||||
for( ICraftingMedium m : cc.getMediums( e.getKey() ) )
|
||||
for( final ICraftingMedium m : cc.getMediums( e.getKey() ) )
|
||||
{
|
||||
if( e.getValue().value <= 0 )
|
||||
{
|
||||
@@ -646,7 +646,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
final IAEItemStack[] input = details.getInputs();
|
||||
double sum = 0;
|
||||
|
||||
for( IAEItemStack anInput : input )
|
||||
for( final IAEItemStack anInput : input )
|
||||
{
|
||||
if( anInput != null )
|
||||
{
|
||||
@@ -736,7 +736,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.somethingChanged = true;
|
||||
this.remainingOperations--;
|
||||
|
||||
for( IAEItemStack out : details.getCondensedOutputs() )
|
||||
for( final IAEItemStack out : details.getCondensedOutputs() )
|
||||
{
|
||||
this.postChange( out, this.machineSrc );
|
||||
this.waitingFor.add( out.copy() );
|
||||
@@ -829,7 +829,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
public ICraftingLink submitJob( IGrid g, ICraftingJob job, BaseActionSource src, ICraftingRequester requestingMachine )
|
||||
public ICraftingLink submitJob( final IGrid g, final ICraftingJob job, final BaseActionSource src, final ICraftingRequester requestingMachine )
|
||||
{
|
||||
if( !this.tasks.isEmpty() || !this.waitingFor.isEmpty() )
|
||||
{
|
||||
@@ -880,7 +880,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
|
||||
this.getListOfItem( list, CraftingItemList.ALL );
|
||||
for( IAEItemStack ge : list )
|
||||
for( final IAEItemStack ge : list )
|
||||
{
|
||||
this.postChange( ge, this.machineSrc );
|
||||
}
|
||||
@@ -893,7 +893,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.inventory.getItemList().resetStatus();
|
||||
}
|
||||
}
|
||||
catch( CraftBranchFailure e )
|
||||
catch( final CraftBranchFailure e )
|
||||
{
|
||||
this.tasks.clear();
|
||||
this.inventory.getItemList().resetStatus();
|
||||
@@ -970,7 +970,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return Long.toString( now, Character.MAX_RADIX ) + '-' + Integer.toString( hash, Character.MAX_RADIX ) + '-' + Integer.toString( hmm, Character.MAX_RADIX );
|
||||
}
|
||||
|
||||
private NBTTagCompound generateLinkData( String craftingID, boolean standalone, boolean req )
|
||||
private NBTTagCompound generateLinkData( final String craftingID, final boolean standalone, final boolean req )
|
||||
{
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
@@ -983,7 +983,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return tag;
|
||||
}
|
||||
|
||||
private void submitLink( ICraftingLink myLastLink2 )
|
||||
private void submitLink( final ICraftingLink myLastLink2 )
|
||||
{
|
||||
if( this.getGrid() != null )
|
||||
{
|
||||
@@ -992,18 +992,18 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
public void getListOfItem( IItemList<IAEItemStack> list, CraftingItemList whichList )
|
||||
public void getListOfItem( final IItemList<IAEItemStack> list, final CraftingItemList whichList )
|
||||
{
|
||||
switch( whichList )
|
||||
{
|
||||
case ACTIVE:
|
||||
for( IAEItemStack ais : this.waitingFor )
|
||||
for( final IAEItemStack ais : this.waitingFor )
|
||||
{
|
||||
list.add( ais );
|
||||
}
|
||||
break;
|
||||
case PENDING:
|
||||
for( Entry<ICraftingPatternDetails, TaskProgress> t : this.tasks.entrySet() )
|
||||
for( final Entry<ICraftingPatternDetails, TaskProgress> t : this.tasks.entrySet() )
|
||||
{
|
||||
for( IAEItemStack ais : t.getKey().getCondensedOutputs() )
|
||||
{
|
||||
@@ -1020,12 +1020,12 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
case ALL:
|
||||
this.inventory.getAvailableItems( list );
|
||||
|
||||
for( IAEItemStack ais : this.waitingFor )
|
||||
for( final IAEItemStack ais : this.waitingFor )
|
||||
{
|
||||
list.add( ais );
|
||||
}
|
||||
|
||||
for( Entry<ICraftingPatternDetails, TaskProgress> t : this.tasks.entrySet() )
|
||||
for( final Entry<ICraftingPatternDetails, TaskProgress> t : this.tasks.entrySet() )
|
||||
{
|
||||
for( IAEItemStack ais : t.getKey().getCondensedOutputs() )
|
||||
{
|
||||
@@ -1038,18 +1038,18 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
public void addStorage( IAEItemStack extractItems )
|
||||
public void addStorage( final IAEItemStack extractItems )
|
||||
{
|
||||
this.inventory.injectItems( extractItems, Actionable.MODULATE, null );
|
||||
}
|
||||
|
||||
public void addEmitable( IAEItemStack i )
|
||||
public void addEmitable( final IAEItemStack i )
|
||||
{
|
||||
this.waitingFor.add( i );
|
||||
this.postCraftingStatusChange( i );
|
||||
}
|
||||
|
||||
public void addCrafting( ICraftingPatternDetails details, long crafts )
|
||||
public void addCrafting( final ICraftingPatternDetails details, final long crafts )
|
||||
{
|
||||
TaskProgress i = this.tasks.get( details );
|
||||
|
||||
@@ -1061,7 +1061,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
i.value += crafts;
|
||||
}
|
||||
|
||||
public IAEItemStack getItemStack( IAEItemStack what, CraftingItemList storage2 )
|
||||
public IAEItemStack getItemStack( final IAEItemStack what, final CraftingItemList storage2 )
|
||||
{
|
||||
IAEItemStack is;
|
||||
|
||||
@@ -1078,9 +1078,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
is = what.copy();
|
||||
is.setStackSize( 0 );
|
||||
|
||||
for( Entry<ICraftingPatternDetails, TaskProgress> t : this.tasks.entrySet() )
|
||||
for( final Entry<ICraftingPatternDetails, TaskProgress> t : this.tasks.entrySet() )
|
||||
{
|
||||
for( IAEItemStack ais : t.getKey().getCondensedOutputs() )
|
||||
for( final IAEItemStack ais : t.getKey().getCondensedOutputs() )
|
||||
{
|
||||
if( ais.equals( is ) )
|
||||
{
|
||||
@@ -1105,7 +1105,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return is;
|
||||
}
|
||||
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
data.setTag( "finalOutput", this.writeItem( this.finalOutput ) );
|
||||
data.setTag( "inventory", this.writeList( this.inventory.getItemList() ) );
|
||||
@@ -1120,7 +1120,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
|
||||
final NBTTagList list = new NBTTagList();
|
||||
for( Entry<ICraftingPatternDetails, TaskProgress> e : this.tasks.entrySet() )
|
||||
for( final Entry<ICraftingPatternDetails, TaskProgress> e : this.tasks.entrySet() )
|
||||
{
|
||||
final NBTTagCompound item = this.writeItem( AEItemStack.create( e.getKey().getPattern() ) );
|
||||
item.setLong( "craftingProgress", e.getValue().value );
|
||||
@@ -1135,7 +1135,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
data.setLong( "remainingItemCount", this.getRemainingItemCount() );
|
||||
}
|
||||
|
||||
private NBTTagCompound writeItem( IAEItemStack finalOutput2 )
|
||||
private NBTTagCompound writeItem( final IAEItemStack finalOutput2 )
|
||||
{
|
||||
final NBTTagCompound out = new NBTTagCompound();
|
||||
|
||||
@@ -1147,11 +1147,11 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return out;
|
||||
}
|
||||
|
||||
private NBTTagList writeList( IItemList<IAEItemStack> myList )
|
||||
private NBTTagList writeList( final IItemList<IAEItemStack> myList )
|
||||
{
|
||||
final NBTTagList out = new NBTTagList();
|
||||
|
||||
for( IAEItemStack ais : myList )
|
||||
for( final IAEItemStack ais : myList )
|
||||
{
|
||||
out.appendTag( this.writeItem( ais ) );
|
||||
}
|
||||
@@ -1175,10 +1175,10 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.updateName();
|
||||
}
|
||||
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
this.finalOutput = AEItemStack.loadItemStackFromNBT( (NBTTagCompound) data.getTag( "finalOutput" ) );
|
||||
for( IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) ) )
|
||||
for( final IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) ) )
|
||||
{
|
||||
this.inventory.injectItems( ais, Actionable.MODULATE, this.machineSrc );
|
||||
}
|
||||
@@ -1212,7 +1212,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
|
||||
this.waitingFor = this.readList( (NBTTagList) data.getTag( "waitingFor" ) );
|
||||
for( IAEItemStack is : this.waitingFor )
|
||||
for( final IAEItemStack is : this.waitingFor )
|
||||
{
|
||||
this.postCraftingStatusChange( is.copy() );
|
||||
}
|
||||
@@ -1226,7 +1226,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
public void updateName()
|
||||
{
|
||||
this.myName = "";
|
||||
for( TileCraftingTile te : this.tiles )
|
||||
for( final TileCraftingTile te : this.tiles )
|
||||
{
|
||||
|
||||
if( te.hasCustomName() )
|
||||
@@ -1243,7 +1243,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
private IItemList<IAEItemStack> readList( NBTTagList tag )
|
||||
private IItemList<IAEItemStack> readList( final NBTTagList tag )
|
||||
{
|
||||
final IItemList<IAEItemStack> out = AEApi.instance().storage().createItemList();
|
||||
|
||||
@@ -1269,7 +1269,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return this.getCore().getWorld();
|
||||
}
|
||||
|
||||
public boolean isMaking( IAEItemStack what )
|
||||
public boolean isMaking( final IAEItemStack what )
|
||||
{
|
||||
final IAEItemStack wat = this.waitingFor.findPrecise( what );
|
||||
return wat != null && wat.getStackSize() > 0;
|
||||
@@ -1296,7 +1296,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.getListOfItem( list, CraftingItemList.PENDING );
|
||||
|
||||
int itemCount = 0;
|
||||
for( IAEItemStack ge : list )
|
||||
for( final IAEItemStack ge : list )
|
||||
{
|
||||
itemCount += ge.getStackSize();
|
||||
}
|
||||
@@ -1305,7 +1305,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.remainingItemCount = itemCount;
|
||||
}
|
||||
|
||||
private void updateElapsedTime( IAEItemStack is )
|
||||
private void updateElapsedTime( final IAEItemStack is )
|
||||
{
|
||||
final long nextStartTime = System.nanoTime();
|
||||
this.elapsedTime = this.getElapsedTime() + nextStartTime - lastTime;
|
||||
|
||||
@@ -39,21 +39,21 @@ public class QuantumCalculator extends MBCalculator
|
||||
|
||||
private final TileQuantumBridge tqb;
|
||||
|
||||
public QuantumCalculator( IAEMultiBlock t )
|
||||
public QuantumCalculator( final IAEMultiBlock t )
|
||||
{
|
||||
super( t );
|
||||
this.tqb = (TileQuantumBridge) t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMultiblockScale( WorldCoord min, WorldCoord max )
|
||||
public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
|
||||
if( ( max.x - min.x + 1 ) * ( max.y - min.y + 1 ) * ( max.z - min.z + 1 ) == 9 )
|
||||
{
|
||||
int ones = ( ( max.x - min.x ) == 0 ? 1 : 0 ) + ( ( max.y - min.y ) == 0 ? 1 : 0 ) + ( ( max.z - min.z ) == 0 ? 1 : 0 );
|
||||
final int ones = ( ( max.x - min.x ) == 0 ? 1 : 0 ) + ( ( max.y - min.y ) == 0 ? 1 : 0 ) + ( ( max.z - min.z ) == 0 ? 1 : 0 );
|
||||
|
||||
int threes = ( ( max.x - min.x ) == 2 ? 1 : 0 ) + ( ( max.y - min.y ) == 2 ? 1 : 0 ) + ( ( max.z - min.z ) == 2 ? 1 : 0 );
|
||||
final int threes = ( ( max.x - min.x ) == 2 ? 1 : 0 ) + ( ( max.y - min.y ) == 2 ? 1 : 0 ) + ( ( max.z - min.z ) == 2 ? 1 : 0 );
|
||||
|
||||
return ones == 1 && threes == 2;
|
||||
}
|
||||
@@ -61,13 +61,13 @@ public class QuantumCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAECluster createCluster( World w, WorldCoord min, WorldCoord max )
|
||||
public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
return new QuantumCluster( min, max );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max )
|
||||
public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
|
||||
byte num = 0;
|
||||
@@ -78,8 +78,8 @@ public class QuantumCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
BlockPos p = new BlockPos( x, y, z );
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( p );
|
||||
final BlockPos p = new BlockPos( x, y, z );
|
||||
final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( p );
|
||||
|
||||
if( !te.isValid() )
|
||||
{
|
||||
@@ -115,11 +115,11 @@ public class QuantumCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max )
|
||||
public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
byte num = 0;
|
||||
byte ringNum = 0;
|
||||
QuantumCluster c = (QuantumCluster) cl;
|
||||
final QuantumCluster c = (QuantumCluster) cl;
|
||||
|
||||
for( int x = min.x; x <= max.x; x++ )
|
||||
{
|
||||
@@ -127,10 +127,10 @@ public class QuantumCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
final TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
|
||||
num++;
|
||||
byte flags;
|
||||
final byte flags;
|
||||
if( num == 5 )
|
||||
{
|
||||
flags = num;
|
||||
@@ -157,14 +157,14 @@ public class QuantumCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidTile( TileEntity te )
|
||||
public boolean isValidTile( final TileEntity te )
|
||||
{
|
||||
return te instanceof TileQuantumBridge;
|
||||
}
|
||||
|
||||
private boolean isBlockAtLocation( IBlockAccess w, BlockPos pos, IBlockDefinition def )
|
||||
private boolean isBlockAtLocation( final IBlockAccess w, final BlockPos pos, final IBlockDefinition def )
|
||||
{
|
||||
for( Block block : def.maybeBlock().asSet() )
|
||||
for( final Block block : def.maybeBlock().asSet() )
|
||||
{
|
||||
return block == w.getBlockState( pos ).getBlock();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
private long otherSide;
|
||||
private TileQuantumBridge center;
|
||||
|
||||
public QuantumCluster( WorldCoord min, WorldCoord max )
|
||||
public QuantumCluster( final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
@@ -65,7 +65,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onUnload( WorldEvent.Unload e )
|
||||
public void onUnload( final WorldEvent.Unload e )
|
||||
{
|
||||
if( this.center.getWorld() == e.world )
|
||||
{
|
||||
@@ -75,10 +75,10 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus( boolean updateGrid )
|
||||
public void updateStatus( final boolean updateGrid )
|
||||
{
|
||||
|
||||
long qe = this.center.getQEFrequency();
|
||||
final long qe = this.center.getQEFrequency();
|
||||
|
||||
if( this.thisSide != qe && this.thisSide != -qe )
|
||||
{
|
||||
@@ -111,23 +111,23 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
}
|
||||
}
|
||||
|
||||
ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide );
|
||||
final ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy( this.otherSide );
|
||||
|
||||
boolean shutdown = false;
|
||||
|
||||
if( myOtherSide instanceof QuantumCluster )
|
||||
{
|
||||
QuantumCluster sideA = this;
|
||||
QuantumCluster sideB = (QuantumCluster) myOtherSide;
|
||||
final QuantumCluster sideA = this;
|
||||
final QuantumCluster sideB = (QuantumCluster) myOtherSide;
|
||||
|
||||
if( sideA.isActive() && sideB.isActive() )
|
||||
{
|
||||
if( this.connection != null && this.connection.connection != null )
|
||||
{
|
||||
IGridNode a = this.connection.connection.a();
|
||||
IGridNode b = this.connection.connection.b();
|
||||
IGridNode sa = sideA.getNode();
|
||||
IGridNode sb = sideB.getNode();
|
||||
final IGridNode a = this.connection.connection.a();
|
||||
final IGridNode b = this.connection.connection.b();
|
||||
final IGridNode sa = sideA.getNode();
|
||||
final IGridNode sb = sideB.getNode();
|
||||
if( ( a == sa || b == sa ) && ( a == sb || b == sb ) )
|
||||
{
|
||||
return;
|
||||
@@ -156,7 +156,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
|
||||
sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance().createGridConnection( sideA.getNode(), sideB.getNode() ) );
|
||||
}
|
||||
catch( FailedConnection e )
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -182,21 +182,21 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canUseNode( long qe )
|
||||
public boolean canUseNode( final long qe )
|
||||
{
|
||||
QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe );
|
||||
final QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe );
|
||||
if( qc != null )
|
||||
{
|
||||
World theWorld = qc.center.getWorld();
|
||||
final World theWorld = qc.center.getWorld();
|
||||
if( !qc.isDestroyed )
|
||||
{
|
||||
Chunk c = theWorld.getChunkFromBlockCoords( qc.center.getPos() );
|
||||
final Chunk c = theWorld.getChunkFromBlockCoords( qc.center.getPos() );
|
||||
if( c.isLoaded() )
|
||||
{
|
||||
int id = theWorld.provider.getDimensionId();
|
||||
World cur = DimensionManager.getWorld( id );
|
||||
final int id = theWorld.provider.getDimensionId();
|
||||
final World cur = DimensionManager.getWorld( id );
|
||||
|
||||
TileEntity te = theWorld.getTileEntity( qc.center.getPos() );
|
||||
final TileEntity te = theWorld.getTileEntity( qc.center.getPos() );
|
||||
return te != qc.center || theWorld != cur;
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
|
||||
this.center.updateStatus( null, (byte) -1, this.updateStatus );
|
||||
|
||||
for( TileQuantumBridge r : this.Ring )
|
||||
for( final TileQuantumBridge r : this.Ring )
|
||||
{
|
||||
r.updateStatus( null, (byte) -1, this.updateStatus );
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
return new ChainedIterator<IGridHost>( this.Ring[0], this.Ring[1], this.Ring[2], this.Ring[3], this.Ring[4], this.Ring[5], this.Ring[6], this.Ring[7], this.center );
|
||||
}
|
||||
|
||||
public boolean isCorner( TileQuantumBridge tileQuantumBridge )
|
||||
public boolean isCorner( final TileQuantumBridge tileQuantumBridge )
|
||||
{
|
||||
return this.Ring[0] == tileQuantumBridge || this.Ring[2] == tileQuantumBridge || this.Ring[4] == tileQuantumBridge || this.Ring[6] == tileQuantumBridge;
|
||||
}
|
||||
@@ -278,7 +278,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
return this.center;
|
||||
}
|
||||
|
||||
public void setCenter( TileQuantumBridge c )
|
||||
public void setCenter( final TileQuantumBridge c )
|
||||
{
|
||||
this.registered = true;
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
|
||||
@@ -35,26 +35,26 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
|
||||
private final TileSpatialPylon tqb;
|
||||
|
||||
public SpatialPylonCalculator( IAEMultiBlock t )
|
||||
public SpatialPylonCalculator( final IAEMultiBlock t )
|
||||
{
|
||||
super( t );
|
||||
this.tqb = (TileSpatialPylon) t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMultiblockScale( WorldCoord min, WorldCoord max )
|
||||
public boolean checkMultiblockScale( final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
return ( min.x == max.x && min.y == max.y && min.z != max.z ) || ( min.x == max.x && min.y != max.y && min.z == max.z ) || ( min.x != max.x && min.y == max.y && min.z == max.z );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAECluster createCluster( World w, WorldCoord min, WorldCoord max )
|
||||
public IAECluster createCluster( final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
return new SpatialPylonCluster( new DimensionalCoord( w, min.x, min.y, min.z ), new DimensionalCoord( w, max.x, max.y, max.z ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyInternalStructure( World w, WorldCoord min, WorldCoord max )
|
||||
public boolean verifyInternalStructure( final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
|
||||
for( int x = min.x; x <= max.x; x++ )
|
||||
@@ -63,7 +63,7 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
final IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
|
||||
if( !te.isValid() )
|
||||
{
|
||||
@@ -83,9 +83,9 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTiles( IAECluster cl, World w, WorldCoord min, WorldCoord max )
|
||||
public void updateTiles( final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max )
|
||||
{
|
||||
SpatialPylonCluster c = (SpatialPylonCluster) cl;
|
||||
final SpatialPylonCluster c = (SpatialPylonCluster) cl;
|
||||
|
||||
for( int x = min.x; x <= max.x; x++ )
|
||||
{
|
||||
@@ -93,7 +93,7 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
final TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
te.updateStatus( c );
|
||||
c.line.add( ( te ) );
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidTile( TileEntity te )
|
||||
public boolean isValidTile( final TileEntity te )
|
||||
{
|
||||
return te instanceof TileSpatialPylon;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SpatialPylonCluster implements IAECluster
|
||||
public boolean hasPower;
|
||||
public boolean hasChannel;
|
||||
|
||||
public SpatialPylonCluster( DimensionalCoord min, DimensionalCoord max )
|
||||
public SpatialPylonCluster( final DimensionalCoord min, final DimensionalCoord max )
|
||||
{
|
||||
this.min = min.copy();
|
||||
this.max = max.copy();
|
||||
@@ -66,9 +66,9 @@ public class SpatialPylonCluster implements IAECluster
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus( boolean updateGrid )
|
||||
public void updateStatus( final boolean updateGrid )
|
||||
{
|
||||
for( TileSpatialPylon r : this.line )
|
||||
for( final TileSpatialPylon r : this.line )
|
||||
{
|
||||
r.recalculateDisplay();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class SpatialPylonCluster implements IAECluster
|
||||
}
|
||||
this.isDestroyed = true;
|
||||
|
||||
for( TileSpatialPylon r : this.line )
|
||||
for( final TileSpatialPylon r : this.line )
|
||||
{
|
||||
r.updateStatus( null );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user