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);
}
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);
}
Aggregations