Search in sources :

Example 1 with CompressorRecipe

use of techreborn.api.recipe.machines.CompressorRecipe in project TechReborn by TechReborn.

the class CTCompressor method addRecipe.

@ZenMethod
public static void addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) {
    Object oInput1 = CraftTweakerCompat.toObject(input1);
    CompressorRecipe r = new CompressorRecipe(oInput1, CraftTweakerCompat.toStack(output1), ticktime, euTick);
    addRecipe(r);
}
Also used : CompressorRecipe(techreborn.api.recipe.machines.CompressorRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 2 with CompressorRecipe

use of techreborn.api.recipe.machines.CompressorRecipe in project TechReborn by TechReborn.

the class ModRecipes method addCompressorRecipes.

private static void addCompressorRecipes() {
    RecipeHandler.addRecipe(new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"), ItemPlates.getPlateByName("advanced_alloy"), 400, 20));
    RecipeHandler.addRecipe(new CompressorRecipe(IC2Duplicates.CARBON_MESH.getStackBasedOnConfig(), ItemPlates.getPlateByName("carbon"), 400, 2));
    RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("plankWood", 1), OreUtil.getStackFromName("plateWood", 1), 300, 4));
    RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("dustLazurite", 1), ItemPlates.getPlateByName("lazurite", 1), 300, 4));
    ItemStack plate;
    for (String ore : OreUtil.oreNames) {
        if (ore.equals("iridium")) {
            continue;
        }
        if (OreUtil.hasPlate(ore)) {
            try {
                plate = ItemPlates.getPlateByName(ore, 1);
            } catch (InvalidParameterException e) {
                plate = OreUtil.getStackFromName("plate" + OreUtil.capitalizeFirstLetter(ore), 1);
            }
            if (plate.isEmpty()) {
                continue;
            }
            if (OreUtil.hasIngot(ore)) {
                RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("ingot" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4));
            }
            if (OreUtil.hasGem(ore) && OreUtil.hasDust(ore)) {
                RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("dust" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4));
            }
            if (OreUtil.hasBlock(ore)) {
                ItemStack morePlates = plate.copy();
                morePlates.setCount(9);
                RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("block" + OreUtil.capitalizeFirstLetter(ore), 1), morePlates, 300, 4));
            }
        }
    }
}
Also used : InvalidParameterException(java.security.InvalidParameterException) CompressorRecipe(techreborn.api.recipe.machines.CompressorRecipe) ItemStack(net.minecraft.item.ItemStack)

Aggregations

CompressorRecipe (techreborn.api.recipe.machines.CompressorRecipe)2 InvalidParameterException (java.security.InvalidParameterException)1 ItemStack (net.minecraft.item.ItemStack)1 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)1