Assembler now shows "powered status" properly.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user