Search in sources :

Example 1 with ICircuit

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

the class ModuleMail method registerRecipes.

@Override
public void registerRecipes() {
    ItemRegistryCore coreItems = ModuleCore.getItems();
    ItemRegistryMail items = getItems();
    BlockRegistryMail blocks = getBlocks();
    ItemStack stampGlue;
    ItemStack letterGlue;
    if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.APICULTURE))) {
        ItemRegistryApiculture beeItems = ModuleApiculture.getItems();
        stampGlue = beeItems.honeyDrop.getItemStack();
        letterGlue = beeItems.propolis.getWildcard();
    } else {
        stampGlue = new ItemStack(Items.SLIME_BALL);
        letterGlue = new ItemStack(Items.SLIME_BALL);
    }
    RecipeUtil.addShapelessRecipe("letter", items.letters.getItemStack(), Items.PAPER, letterGlue);
    if (Config.craftingStampsEnabled) {
        for (EnumStampDefinition stampDefinition : EnumStampDefinition.VALUES) {
            if (Config.collectorStamps.contains(stampDefinition.getUid())) {
                continue;
            }
            ItemStack stamps = items.stamps.get(stampDefinition, 9);
            RecipeUtil.addRecipe("stamps", stamps, "XXX", "###", "ZZZ", 'X', stampDefinition.getCraftingIngredient(), '#', Items.PAPER, 'Z', stampGlue);
            RecipeManagers.carpenterManager.addRecipe(10, Fluids.SEED_OIL.getFluid(300), ItemStack.EMPTY, stamps, "XXX", "###", 'X', stampDefinition.getCraftingIngredient(), '#', Items.PAPER);
        }
    }
    // Recycling
    RecipeUtil.addRecipe("letter_recycling", new ItemStack(Items.PAPER), "###", '#', OreDictUtil.EMPTIED_LETTER_ORE_DICT);
    // Carpenter
    RecipeManagers.carpenterManager.addRecipe(10, new FluidStack(FluidRegistry.WATER, 250), ItemStack.EMPTY, items.letters.getItemStack(), "###", "###", '#', coreItems.woodPulp);
    RecipeUtil.addShapelessRecipe("catalogue", items.catalogue.getItemStack(), items.stamps.getWildcard(), new ItemStack(Items.BOOK));
    RecipeUtil.addRecipe("mailbox", new ItemStack(blocks.mailbox), " # ", "#Y#", "XXX", '#', "ingotTin", 'X', "chestWood", 'Y', coreItems.sturdyCasing);
    RecipeUtil.addRecipe("trade_station", new ItemStack(blocks.tradeStation), "Z#Z", "#Y#", "XWX", '#', coreItems.tubes.get(EnumElectronTube.BRONZE, 1), 'X', "chestWood", 'Y', coreItems.sturdyCasing, 'Z', coreItems.tubes.get(EnumElectronTube.IRON, 1), 'W', ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.REFINED, null, new ICircuit[] {}));
}
Also used : BlockRegistryMail(forestry.mail.blocks.BlockRegistryMail) ItemRegistryCore(forestry.core.items.ItemRegistryCore) FluidStack(net.minecraftforge.fluids.FluidStack) ResourceLocation(net.minecraft.util.ResourceLocation) ItemRegistryApiculture(forestry.apiculture.items.ItemRegistryApiculture) ItemRegistryMail(forestry.mail.items.ItemRegistryMail) ICircuit(forestry.api.circuits.ICircuit) EnumStampDefinition(forestry.mail.items.EnumStampDefinition) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ICircuit

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

the class CircuitBoard method onInsertion.

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

Example 3 with ICircuit

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

the class CircuitBoard method onLoad.

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

Example 4 with ICircuit

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

the class CircuitBoard method addTooltip.

@Override
@SideOnly(Side.CLIENT)
public void addTooltip(List<String> list) {
    if (layout != null) {
        list.add(TextFormatting.GOLD + layout.getUsage() + ":");
        List<String> extendedTooltip = new ArrayList<>();
        for (ICircuit circuit : circuits) {
            if (circuit != null) {
                circuit.addTooltip(extendedTooltip);
            }
        }
        if (GuiScreen.isShiftKeyDown() || extendedTooltip.size() <= 4) {
            list.addAll(extendedTooltip);
        } else {
            list.add(TextFormatting.ITALIC + "<" + Translator.translateToLocal("for.gui.tooltip.tmi") + ">");
        }
    } else {
        int socketCount = type.getSockets();
        String localizationKey = "item.for.circuitboard.tooltip." + (socketCount == 1 ? "singular" : "plural");
        String tooltip = Translator.translateToLocalFormatted(localizationKey, type.getSockets());
        list.add(tooltip);
    }
}
Also used : ArrayList(java.util.ArrayList) ICircuit(forestry.api.circuits.ICircuit) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 5 with ICircuit

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

the class ItemElectronTube method getCircuits.

private static Multimap<ICircuitLayout, ICircuit> getCircuits(ItemStack itemStack) {
    Multimap<ICircuitLayout, ICircuit> circuits = ArrayListMultimap.create();
    Collection<ICircuitLayout> allLayouts = ChipsetManager.circuitRegistry.getRegisteredLayouts().values();
    for (ICircuitLayout circuitLayout : allLayouts) {
        ICircuit circuit = SolderManager.getCircuit(circuitLayout, itemStack);
        if (circuit != null) {
            circuits.put(circuitLayout, circuit);
        }
    }
    return circuits;
}
Also used : ICircuitLayout(forestry.api.circuits.ICircuitLayout) 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