Search in sources :

Example 11 with ICircuitBoard

use of forestry.api.circuits.ICircuitBoard 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

ICircuitBoard (forestry.api.circuits.ICircuitBoard)11 ItemStack (net.minecraft.item.ItemStack)5 StimulatorCircuit (binnie.extrabees.circuit.StimulatorCircuit)1 ICircuit (forestry.api.circuits.ICircuit)1 PacketSocketUpdate (forestry.core.network.packets.PacketSocketUpdate)1 ArrayList (java.util.ArrayList)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1