InscriberRecipe out = getTask();
if ( out != null )
{
ItemStack is = out.output.copy();
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( inv, 3, 1, true ), ForgeDirection.UNKNOWN );
if ( ad.addItems( is ) == null )
{
processingTime = 0;
if ( out.usePlates )
{
setInventorySlotContents( 0, null );
setInventorySlotContents( 1, null );
}
setInventorySlotContents( 2, null );
}
}
markDirty();
}
else if ( finalStep == 16 )
{
finalStep = 0;
smash = false;
markForUpdate();
}
}
else
{
IEnergyGrid eg;
try
{
eg = gridProxy.getEnergy();
IEnergySource src = this;
// Base 1, increase by 1 for each card
int speedFactor = 1 + upgrades.getInstalledUpgrades( Upgrades.SPEED );
int powerConsumption = 10 * speedFactor;
double powerThreshold = powerConsumption - 0.01;
double powerReq = extractAEPower( powerConsumption, Actionable.SIMULATE, PowerMultiplier.CONFIG );
if ( powerReq <= powerThreshold )
{
src = eg;
powerReq = eg.extractAEPower( powerConsumption, Actionable.SIMULATE, PowerMultiplier.CONFIG );
}
if ( powerReq > powerThreshold )
{
src.extractAEPower( powerConsumption, Actionable.MODULATE, PowerMultiplier.CONFIG );
if ( processingTime == 0 )
processingTime = processingTime + speedFactor;
else
processingTime += TicksSinceLastCall * speedFactor;
}
}
catch (GridAccessException e)
{
// :P
}
if ( processingTime > maxProcessingTime )
{
processingTime = maxProcessingTime;
InscriberRecipe out = getTask();
if ( out != null )
{
ItemStack is = out.output.copy();
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( inv, 3, 1, true ), ForgeDirection.UNKNOWN );
if ( ad.simulateAdd( is ) == null )
{
smash = true;
finalStep = 0;
markForUpdate();