Assembler now shows "powered status" properly.

This commit is contained in:
AlgorithmX2 2014-09-11 22:55:30 -05:00
parent c62f415648
commit 04ee699afa

View file

@ -559,7 +559,22 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn
@MENetworkEventSubscribe @MENetworkEventSubscribe
public void onPowerEvent(MENetworkPowerStatusChange p) public void onPowerEvent(MENetworkPowerStatusChange p)
{ {
boolean newState = gridProxy.isActive(); updatePowerState();
}
private void updatePowerState()
{
boolean newState = false;
try
{
newState = gridProxy.isActive() && gridProxy.getEnergy().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.0001;
}
catch (GridAccessException e)
{
}
if ( newState != isPowered ) if ( newState != isPowered )
{ {
isPowered = newState; isPowered = newState;