Search in sources :

Example 1 with ShapedOreEnergyTransferRecipe

use of gregtech.api.util.ShapedOreEnergyTransferRecipe in project GregTech by GregTechCE.

the class ModHandler method addShapedEnergyTransferRecipeWithOverride.

public static void addShapedEnergyTransferRecipeWithOverride(String regName, ItemStack result, Predicate<ItemStack> chargePredicate, boolean overrideCharge, boolean transferMaxCharge, Object... recipe) {
    boolean skip = false;
    if (result.isEmpty()) {
        GTLog.logger.error("Result cannot be an empty ItemStack. Recipe: {}", regName);
        GTLog.logger.error("Stacktrace:", new IllegalArgumentException());
        skip = true;
    }
    skip |= validateRecipe(regName, recipe);
    if (skip) {
        RecipeMap.setFoundInvalidRecipe(true);
        return;
    }
    IRecipe shapedOreRecipe = new ShapedOreEnergyTransferRecipe(null, result.copy(), chargePredicate, overrideCharge, transferMaxCharge, finalizeShapedRecipeInput(recipe)).setMirrored(// make all recipes not mirrored by default
    false).setRegistryName(regName);
    ForgeRegistries.RECIPES.register(shapedOreRecipe);
}
Also used : IRecipe(net.minecraft.item.crafting.IRecipe) ShapedOreEnergyTransferRecipe(gregtech.api.util.ShapedOreEnergyTransferRecipe)

Example 2 with ShapedOreEnergyTransferRecipe

use of gregtech.api.util.ShapedOreEnergyTransferRecipe in project GregTech by GregTechCEu.

the class ModHandler method addShapedEnergyTransferRecipe.

public static void addShapedEnergyTransferRecipe(String regName, ItemStack result, Predicate<ItemStack> chargePredicate, boolean overrideCharge, boolean transferMaxCharge, Object... recipe) {
    boolean skip = false;
    if (result.isEmpty()) {
        GTLog.logger.error("Result cannot be an empty ItemStack. Recipe: {}", regName);
        GTLog.logger.error("Stacktrace:", new IllegalArgumentException());
        skip = true;
    }
    skip |= validateRecipe(regName, recipe);
    if (skip) {
        RecipeMap.setFoundInvalidRecipe(true);
        return;
    }
    IRecipe shapedOreRecipe = new ShapedOreEnergyTransferRecipe(null, result.copy(), chargePredicate, overrideCharge, transferMaxCharge, finalizeShapedRecipeInput(recipe)).setMirrored(// make all recipes not mirrored by default
    false).setRegistryName(regName);
    ForgeRegistries.RECIPES.register(shapedOreRecipe);
}
Also used : IRecipe(net.minecraft.item.crafting.IRecipe) ShapedOreEnergyTransferRecipe(gregtech.api.util.ShapedOreEnergyTransferRecipe)

Aggregations

ShapedOreEnergyTransferRecipe (gregtech.api.util.ShapedOreEnergyTransferRecipe)2 IRecipe (net.minecraft.item.crafting.IRecipe)2