RF Now only inserts up to the overflow.
This commit is contained in:
parent
8373a33301
commit
10939b6001
1 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue