Power Event should fire when power becomes available, even if the networks idle cost is 0.
This commit is contained in:
parent
3329d9455b
commit
c62f415648
1 changed files with 11 additions and 2 deletions
13
me/cache/EnergyGridCache.java
vendored
13
me/cache/EnergyGridCache.java
vendored
|
@ -384,8 +384,17 @@ public class EnergyGridCache implements IEnergyGrid
|
|||
tickInjectionPerTick = 0;
|
||||
|
||||
// power information.
|
||||
double drained = extractAEPower( getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG );
|
||||
boolean currentlyHasPower = drained >= drainPerTick - 0.001;
|
||||
boolean currentlyHasPower = false;
|
||||
|
||||
if ( drainPerTick > 0.0001 )
|
||||
{
|
||||
double drained = extractAEPower( getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG );
|
||||
currentlyHasPower = drained >= drainPerTick - 0.001;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentlyHasPower = extractAEPower( 0.1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0;
|
||||
}
|
||||
|
||||
// ticks since change..
|
||||
if ( currentlyHasPower == hasPower )
|
||||
|
|
Loading…
Reference in a new issue