Search in sources :

Example 6 with ICircuit

use of forestry.api.circuits.ICircuit in project ForestryMC by ForestryMC.

the class ItemElectronTube method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemstack, @Nullable World world, List<String> list, ITooltipFlag flag) {
    super.addInformation(itemstack, world, list, flag);
    Multimap<ICircuitLayout, ICircuit> circuits = getCircuits(itemstack);
    if (!circuits.isEmpty()) {
        if (GuiScreen.isShiftKeyDown()) {
            for (ICircuitLayout circuitLayout : circuits.keys()) {
                String circuitLayoutName = circuitLayout.getUsage();
                list.add(TextFormatting.WHITE.toString() + TextFormatting.UNDERLINE + circuitLayoutName);
                for (ICircuit circuit : circuits.get(circuitLayout)) {
                    circuit.addTooltip(list);
                }
            }
        } else {
            ItemTooltipUtil.addShiftInformation(itemstack, world, list, flag);
        }
    } else {
        list.add("<" + Translator.translateToLocal("for.gui.noeffect") + ">");
    }
}
Also used : ICircuitLayout(forestry.api.circuits.ICircuitLayout) ICircuit(forestry.api.circuits.ICircuit) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 7 with ICircuit

use of forestry.api.circuits.ICircuit in project ForestryMC by ForestryMC.

the class CircuitBoard method onRemoval.

@Override
public void onRemoval(Object tile) {
    for (int i = 0; i < circuits.length; i++) {
        ICircuit circuit = circuits[i];
        if (circuit == null) {
            continue;
        }
        circuit.onRemoval(i, tile);
    }
}
Also used : ICircuit(forestry.api.circuits.ICircuit)

Example 8 with ICircuit

use of forestry.api.circuits.ICircuit in project ForestryMC by ForestryMC.

the class CircuitBoard method writeToNBT.

@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
    nbttagcompound.setShort("T", (short) type.ordinal());
    // Layout
    if (layout != null) {
        nbttagcompound.setString("LY", layout.getUID());
    }
    // Circuits
    for (int i = 0; i < circuits.length; i++) {
        ICircuit circuit = circuits[i];
        if (circuit == null) {
            continue;
        }
        nbttagcompound.setString("CA.I" + i, circuit.getUID());
    }
    return nbttagcompound;
}
Also used : ICircuit(forestry.api.circuits.ICircuit)

Example 9 with ICircuit

use of forestry.api.circuits.ICircuit in project ForestryMC by ForestryMC.

the class CircuitBoard method onTick.

@Override
public void onTick(Object tile) {
    for (int i = 0; i < circuits.length; i++) {
        ICircuit circuit = circuits[i];
        if (circuit == null) {
            continue;
        }
        circuit.onTick(i, tile);
    }
}
Also used : ICircuit(forestry.api.circuits.ICircuit)

Example 10 with ICircuit

use of forestry.api.circuits.ICircuit in project ForestryMC by ForestryMC.

the class ItemInventorySolderingIron method getCircuitCount.

private int getCircuitCount() {
    ICircuit[] circuits = getCircuits(false);
    int count = 0;
    for (ICircuit circuit : circuits) {
        if (circuit != null) {
            count++;
        }
    }
    return count;
}
Also used : ICircuit(forestry.api.circuits.ICircuit)

Aggregations

ICircuit (forestry.api.circuits.ICircuit)14 ICircuitLayout (forestry.api.circuits.ICircuitLayout)4 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 ArrayList (java.util.ArrayList)2 ItemStack (net.minecraft.item.ItemStack)2 StimulatorCircuit (binnie.extrabees.circuit.StimulatorCircuit)1 ICircuitBoard (forestry.api.circuits.ICircuitBoard)1 ItemRegistryApiculture (forestry.apiculture.items.ItemRegistryApiculture)1 EnumCircuitBoardType (forestry.core.circuits.EnumCircuitBoardType)1 ItemRegistryCore (forestry.core.items.ItemRegistryCore)1 BlockRegistryMail (forestry.mail.blocks.BlockRegistryMail)1 EnumStampDefinition (forestry.mail.items.EnumStampDefinition)1 ItemRegistryMail (forestry.mail.items.ItemRegistryMail)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 FluidStack (net.minecraftforge.fluids.FluidStack)1