Search in sources :

Example 1 with ACMode

use of me.retrodaredevil.solarthing.solar.outback.fx.ACMode in project solarthing by wildmountainfarms.

the class GeneratorStateEvent method run.

@Override
public void run(MessageSender sender, FragmentedPacketGroup previous, FragmentedPacketGroup current) {
    FXStatusPacket fx = OutbackUtil.getMasterFX(current);
    if (fx == null)
        return;
    ACMode mode = fx.getACMode();
    final Boolean wasGeneratorOn = this.generatorOn;
    if (mode == ACMode.NO_AC) {
        this.generatorOn = false;
        if (Boolean.TRUE.equals(wasGeneratorOn)) {
            sender.sendMessage("Generator has turned off!");
        }
    } else if (mode == ACMode.AC_USE) {
        this.generatorOn = true;
        if (Boolean.FALSE.equals(wasGeneratorOn)) {
            sender.sendMessage("Generator power being used!");
        }
    }
}
Also used : FXStatusPacket(me.retrodaredevil.solarthing.solar.outback.fx.FXStatusPacket) ACMode(me.retrodaredevil.solarthing.solar.outback.fx.ACMode)

Aggregations

ACMode (me.retrodaredevil.solarthing.solar.outback.fx.ACMode)1 FXStatusPacket (me.retrodaredevil.solarthing.solar.outback.fx.FXStatusPacket)1