Search in sources :

Example 1 with StimulatorCircuit

use of binnie.extrabees.circuit.StimulatorCircuit in project Binnie by ForestryMC.

the class AlvearyLogicStimulator method updateServer.

@Override
public void updateServer(TileEntityExtraBeesAlvearyPart tile) {
    this.modifiers = this.getCircuits();
    this.powerUsage = 0;
    for (final StimulatorCircuit beeMod : this.modifiers) {
        this.powerUsage += beeMod.getPowerUsage();
    }
    this.powered = energyStorage.extractEnergy(powerUsage, true) >= powerUsage;
}
Also used : StimulatorCircuit(binnie.extrabees.circuit.StimulatorCircuit)

Example 2 with StimulatorCircuit

use of binnie.extrabees.circuit.StimulatorCircuit in project Binnie by ForestryMC.

the class AlvearyLogicStimulator method getCircuits.

public StimulatorCircuit[] getCircuits() {
    final ICircuitBoard board = this.getHiveFrame();
    if (board == null) {
        return new StimulatorCircuit[0];
    }
    final ICircuit[] circuits = board.getCircuits();
    final List<StimulatorCircuit> mod = new ArrayList<>();
    for (final ICircuit circuit : circuits) {
        if (circuit instanceof StimulatorCircuit) {
            mod.add((StimulatorCircuit) circuit);
        }
    }
    return mod.toArray(new StimulatorCircuit[0]);
}
Also used : ICircuitBoard(forestry.api.circuits.ICircuitBoard) StimulatorCircuit(binnie.extrabees.circuit.StimulatorCircuit) ArrayList(java.util.ArrayList) ICircuit(forestry.api.circuits.ICircuit)

Aggregations

StimulatorCircuit (binnie.extrabees.circuit.StimulatorCircuit)2 ICircuit (forestry.api.circuits.ICircuit)1 ICircuitBoard (forestry.api.circuits.ICircuitBoard)1 ArrayList (java.util.ArrayList)1