Search in sources :

Example 26 with UnificationEntry

use of gregtech.api.unification.stack.UnificationEntry in project GregTech by GregTechCE.

the class OreRecipeHandler method processCrushedCentrifuged.

public static void processCrushedCentrifuged(OrePrefix centrifugedPrefix, DustMaterial material) {
    ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, material);
    ItemStack byproductStack = OreDictUnifier.get(OrePrefix.dust, GTUtility.selectItemInList(2, material, material.oreByProducts, DustMaterial.class), 1);
    RecipeMaps.FORGE_HAMMER_RECIPES.recipeBuilder().input(centrifugedPrefix, material).outputs(dustStack).duration(60).EUt(8).buildAndRegister();
    RecipeMaps.MACERATOR_RECIPES.recipeBuilder().input(centrifugedPrefix, material).outputs(dustStack).chancedOutput(byproductStack, 1400, 850).duration(200).EUt(12).buildAndRegister();
    ModHandler.addShapelessRecipe(String.format("centrifuged_ore_to_dust_%s", material), dustStack, 'h', new UnificationEntry(centrifugedPrefix, material));
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

Example 27 with UnificationEntry

use of gregtech.api.unification.stack.UnificationEntry in project GregTech by GregTechCE.

the class PipeRecipeHandler method processPipeNormal.

private static void processPipeNormal(OrePrefix pipePrefix, IngotMaterial material) {
    ItemStack pipeStack = OreDictUnifier.get(pipePrefix, material);
    RecipeMaps.EXTRUDER_RECIPES.recipeBuilder().input(OrePrefix.ingot, material, 3).notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_MEDIUM).outputs(pipeStack).duration((int) material.getAverageMass()).EUt(6 * getVoltageMultiplier(material)).buildAndRegister();
    ModHandler.addShapedRecipe(String.format("medium_%s_pipe", material.toString()), GTUtility.copyAmount(2, pipeStack), "XXX", "f h", "XXX", 'X', new UnificationEntry(OrePrefix.plate, material));
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

Example 28 with UnificationEntry

use of gregtech.api.unification.stack.UnificationEntry in project GregTech by GregTechCE.

the class ToolRecipeHandler method processHammerHead.

public static void processHammerHead(OrePrefix toolPrefix, SolidMaterial solidMaterial) {
    if (!solidMaterial.hasFlag(NO_WORKING)) {
        processSimpleToolHead(toolPrefix, solidMaterial, MetaItems.HARD_HAMMER, "II ", "IIh", "II ");
    }
    SolidMaterial handleMaterial = Materials.Wood;
    if (!solidMaterial.hasFlag(NO_WORKING)) {
        ModHandler.addShapedRecipe(String.format("hammer_%s", solidMaterial.toString()), MetaItems.HARD_HAMMER.getStackForm(solidMaterial), "XX ", "XXS", "XX ", 'X', new UnificationEntry(OrePrefix.ingot, solidMaterial), 'S', new UnificationEntry(OrePrefix.stick, handleMaterial));
    }
    if (!solidMaterial.hasFlag(DustMaterial.MatFlags.NO_SMASHING)) {
        int voltageMultiplier = getVoltageMultiplier(solidMaterial);
        RecipeMaps.EXTRUDER_RECIPES.recipeBuilder().input(OrePrefix.ingot, solidMaterial, 6).notConsumable(MetaItems.SHAPE_EXTRUDER_HAMMER).outputs(OreDictUnifier.get(toolPrefix, solidMaterial)).duration((int) solidMaterial.getAverageMass() * 6).EUt(8 * voltageMultiplier).buildAndRegister();
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry)

Example 29 with UnificationEntry

use of gregtech.api.unification.stack.UnificationEntry in project GregTech by GregTechCE.

the class ToolRecipeHandler method processWrenchHead.

public static void processWrenchHead(OrePrefix toolPrefix, SolidMaterial solidMaterial) {
    processSimpleElectricToolHead(toolPrefix, solidMaterial, new MetaToolValueItem[] { MetaItems.WRENCH_LV, MetaItems.WRENCH_MV, MetaItems.WRENCH_HV });
    ModHandler.addShapedRecipe(String.format("wrench_head_%s", solidMaterial.toString()), OreDictUnifier.get(OrePrefix.toolHeadWrench, solidMaterial), "hXW", "XRX", "WXd", 'X', new UnificationEntry(OrePrefix.plate, solidMaterial), 'R', new UnificationEntry(OrePrefix.ring, Materials.Steel), 'W', new UnificationEntry(OrePrefix.screw, Materials.Steel));
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry)

Example 30 with UnificationEntry

use of gregtech.api.unification.stack.UnificationEntry in project GregTech by GregTechCE.

the class ToolRecipeHandler method processSimpleToolHead.

public static void processSimpleToolHead(OrePrefix toolPrefix, SolidMaterial solidMaterial, MetaToolValueItem toolItem, Object... recipe) {
    Material handleMaterial = Materials.Wood;
    ModHandler.addShapelessRecipe(String.format("%s_%s_%s", toolPrefix.name(), solidMaterial, handleMaterial), toolItem.getStackForm(solidMaterial), new UnificationEntry(toolPrefix, solidMaterial), new UnificationEntry(OrePrefix.stick, handleMaterial));
    if (solidMaterial instanceof IngotMaterial && solidMaterial.hasFlag(GENERATE_PLATE)) {
        addSimpleToolRecipe(toolPrefix, solidMaterial, toolItem, new UnificationEntry(OrePrefix.plate, solidMaterial), new UnificationEntry(OrePrefix.ingot, solidMaterial), recipe);
    }
    if (solidMaterial instanceof GemMaterial) {
        addSimpleToolRecipe(toolPrefix, solidMaterial, toolItem, new UnificationEntry(OrePrefix.gem, solidMaterial), new UnificationEntry(OrePrefix.gem, solidMaterial), recipe);
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry)

Aggregations

UnificationEntry (gregtech.api.unification.stack.UnificationEntry)65 ItemStack (net.minecraft.item.ItemStack)50 OrePrefix (gregtech.api.unification.ore.OrePrefix)11 Material (gregtech.api.unification.material.type.Material)10 SimpleItemStack (gregtech.api.unification.stack.SimpleItemStack)10 MaterialStack (gregtech.api.unification.stack.MaterialStack)8 IntCircuitIngredient (gregtech.api.recipes.ingredients.IntCircuitIngredient)6 SolidMaterial (gregtech.api.unification.material.type.SolidMaterial)6 MetaValueItem (gregtech.api.items.metaitem.MetaItem.MetaValueItem)5 CountableIngredient (gregtech.api.recipes.CountableIngredient)5 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)5 ItemMaterialInfo (gregtech.api.unification.stack.ItemMaterialInfo)4 Nullable (javax.annotation.Nullable)4 CaseFormat (com.google.common.base.CaseFormat)3 Joiner (com.google.common.base.Joiner)3 ImmutableList (com.google.common.collect.ImmutableList)3 GTValues (gregtech.api.GTValues)3 M (gregtech.api.GTValues.M)3 ToolMetaItem (gregtech.api.items.toolitem.ToolMetaItem)3 ModHandler (gregtech.api.recipes.ModHandler)3