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") + ">");
}
}
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);
}
}
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;
}
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);
}
}
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;
}
Aggregations