Search in sources :

Example 21 with UnificationEntry

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

the class MaterialRecipeHandler method processGem.

public static void processGem(OrePrefix gemPrefix, GemMaterial material) {
    long materialAmount = gemPrefix.materialAmount;
    ItemStack crushedStack = OreDictUnifier.getDust(material, materialAmount);
    if (material.hasFlag(MORTAR_GRINDABLE)) {
        ModHandler.addShapedRecipe(String.format("gem_to_dust_%s_%s", material, gemPrefix), crushedStack, "X", "m", 'X', new UnificationEntry(gemPrefix, material));
    }
    OrePrefix prevPrefix = GTUtility.getItem(GEM_ORDER, GEM_ORDER.indexOf(gemPrefix) - 1, null);
    ItemStack prevStack = prevPrefix == null ? ItemStack.EMPTY : OreDictUnifier.get(prevPrefix, material, 2);
    if (!prevStack.isEmpty()) {
        ModHandler.addShapelessRecipe(String.format("gem_to_gem_%s_%s", prevPrefix, material), prevStack, "h", new UnificationEntry(gemPrefix, material));
        RecipeMaps.FORGE_HAMMER_RECIPES.recipeBuilder().input(gemPrefix, material).outputs(prevStack).duration(20).EUt(16).buildAndRegister();
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) OrePrefix(gregtech.api.unification.ore.OrePrefix) ItemStack(net.minecraft.item.ItemStack)

Example 22 with UnificationEntry

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

the class MaterialRecipeHandler method processTinyDust.

public static void processTinyDust(OrePrefix orePrefix, DustMaterial material) {
    ItemStack tinyDustStack = OreDictUnifier.get(orePrefix, material);
    ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, material);
    ModHandler.addShapedRecipe(String.format("tiny_dust_disassembling_%s", material.toString()), GTUtility.copyAmount(9, tinyDustStack), "X ", "  ", 'X', new UnificationEntry(OrePrefix.dust, material));
    ModHandler.addShapedRecipe(String.format("tiny_dust_assembling_%s", material.toString()), dustStack, "XXX", "XXX", "XXX", 'X', new UnificationEntry(orePrefix, material));
    RecipeMaps.PACKER_RECIPES.recipeBuilder().input(orePrefix, material, 9).inputs(new CountableIngredient(new IntCircuitIngredient(1), 0)).outputs(dustStack).buildAndRegister();
    RecipeMaps.UNPACKER_RECIPES.recipeBuilder().input(OrePrefix.dust, material).inputs(new CountableIngredient(new IntCircuitIngredient(1), 0)).outputs(GTUtility.copyAmount(9, tinyDustStack)).buildAndRegister();
}
Also used : IntCircuitIngredient(gregtech.api.recipes.ingredients.IntCircuitIngredient) UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack) CountableIngredient(gregtech.api.recipes.CountableIngredient)

Example 23 with UnificationEntry

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

the class PartsRecipeHandler method processStick.

public static void processStick(OrePrefix stickPrefix, DustMaterial material) {
    if (material instanceof GemMaterial || material instanceof IngotMaterial) {
        RecipeMaps.LATHE_RECIPES.recipeBuilder().input(material instanceof GemMaterial ? OrePrefix.gem : OrePrefix.ingot, material).outputs(OreDictUnifier.get(OrePrefix.stick, material, 2)).duration((int) Math.max(material.getAverageMass() * 2, 1)).EUt(16).buildAndRegister();
    }
    if (material.hasFlag(GENERATE_BOLT_SCREW)) {
        ItemStack boltStack = OreDictUnifier.get(OrePrefix.bolt, material);
        RecipeMaps.CUTTER_RECIPES.recipeBuilder().input(stickPrefix, material).outputs(GTUtility.copyAmount(4, boltStack)).duration((int) Math.max(material.getAverageMass() * 2L, 1L)).EUt(4).buildAndRegister();
        ModHandler.addShapedRecipe(String.format("bolt_saw_%s", material.toString()), GTUtility.copyAmount(2, boltStack), "s ", " X", 'X', new UnificationEntry(OrePrefix.stick, material));
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

Example 24 with UnificationEntry

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

the class PartsRecipeHandler method processFineWire.

public static void processFineWire(OrePrefix fineWirePrefix, IngotMaterial material) {
    ItemStack fineWireStack = OreDictUnifier.get(fineWirePrefix, material);
    ModHandler.addShapelessRecipe(String.format("fine_wire_%s", material.toString()), fineWireStack, 'x', new UnificationEntry(OrePrefix.foil, material));
    if (material.cableProperties != null) {
        RecipeMaps.WIREMILL_RECIPES.recipeBuilder().input(OrePrefix.wireGtSingle, material).outputs(OreDictUnifier.get(OrePrefix.wireFine, material, 4)).duration(200).EUt(8).buildAndRegister();
    } else {
        RecipeMaps.WIREMILL_RECIPES.recipeBuilder().input(OrePrefix.ingot, material).outputs(OreDictUnifier.get(OrePrefix.wireFine, material, 8)).duration(400).EUt(8).buildAndRegister();
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

Example 25 with UnificationEntry

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

the class PartsRecipeHandler method processPlate.

public static void processPlate(OrePrefix platePrefix, DustMaterial material) {
    if (material.shouldGenerateFluid()) {
        RecipeMaps.FLUID_SOLIDFICATION_RECIPES.recipeBuilder().notConsumable(MetaItems.SHAPE_MOLD_PLATE).fluidInputs(material.getFluid(L)).outputs(OreDictUnifier.get(platePrefix, material)).duration(40).EUt(8).buildAndRegister();
    }
    if (material.hasFlag(MORTAR_GRINDABLE)) {
        ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, material);
        ModHandler.addShapedRecipe(String.format("plate_to_dust_%s", material), dustStack, "X", "m", 'X', new UnificationEntry(OrePrefix.plate, material));
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) ItemStack(net.minecraft.item.ItemStack)

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