Tweaked Energy Flow Code for Network Acceptor, should be more what I'm looking for.

This commit is contained in:
AlgorithmX2
2014-06-07 19:23:31 -05:00
parent 9ae4ce54d1
commit 14aba981b2
5 changed files with 11 additions and 8 deletions
+4
View File
@@ -30,6 +30,10 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt
@Method(iname = "MJ6")
public double addEnergy(double amount)
{
double demand = getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
if ( amount > demand )
amount = demand;
double overflow = injectExternalPower( PowerUnits.MJ, amount );
return amount - overflow;
}