RF Now only inserts up to the overflow.

This commit is contained in:
AlgorithmX2 2014-06-02 01:33:16 -05:00
parent 8373a33301
commit 10939b6001

View file

@ -21,10 +21,21 @@ public abstract class RedstoneFlux extends RotaryCraft implements IEnergyHandler
}
else
{
double overFlow = injectExternalPower( PowerUnits.RF, maxReceive );
int demand = (int) Math.floor( getExternalPowerDemand( PowerUnits.RF ) );
int ignored = 0;
int insertAmt = maxReceive;
if ( insertAmt > demand )
{
ignored = insertAmt - demand;
insertAmt = demand;
}
double overFlow = injectExternalPower( PowerUnits.RF, insertAmt );
double ox = Math.floor( overFlow );
internalCurrentPower += PowerUnits.RF.convertTo( PowerUnits.AE, overFlow - ox );
return maxReceive - (int) ox;
return maxReceive - ((int) ox + ignored);
}
}