diff --git a/gradle.properties b/gradle.properties index f78efda49..ed0ce3adf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ curse_project_id=238222 version_major=4 version_minor=14 -version_patch=0 +version_patch=1 diff --git a/src/api/java/mezz/jei/api/recipe/IVanillaRecipeFactory.java b/src/api/java/mezz/jei/api/recipe/IVanillaRecipeFactory.java index d095459f4..04221ba8c 100644 --- a/src/api/java/mezz/jei/api/recipe/IVanillaRecipeFactory.java +++ b/src/api/java/mezz/jei/api/recipe/IVanillaRecipeFactory.java @@ -27,6 +27,18 @@ public interface IVanillaRecipeFactory { */ IRecipeWrapper createAnvilRecipe(ItemStack leftInput, List rightInputs, List outputs); + /** + * Adds an anvil recipe for the given inputs and output. + * The number of inputs in the left and right side must match. + * + * @param leftInputs The itemStack(s) placed on the left slot. + * @param rightInputs The itemStack(s) placed on the right slot. + * @param outputs The resulting itemStack(s). + * @return the {@link IRecipeWrapper} for this recipe. + * @since JEI 4.14.1 + */ + IRecipeWrapper createAnvilRecipe(List leftInputs, List rightInputs, List outputs); + /** * Create a new smelting recipe. * By default, all smelting recipes from {@link FurnaceRecipes#smeltingList} are already added by JEI. diff --git a/src/main/java/mezz/jei/plugins/vanilla/VanillaRecipeFactory.java b/src/main/java/mezz/jei/plugins/vanilla/VanillaRecipeFactory.java index 9677350c2..893a4d1fc 100644 --- a/src/main/java/mezz/jei/plugins/vanilla/VanillaRecipeFactory.java +++ b/src/main/java/mezz/jei/plugins/vanilla/VanillaRecipeFactory.java @@ -1,5 +1,6 @@ package mezz.jei.plugins.vanilla; +import java.util.Collections; import java.util.List; import com.google.common.base.Preconditions; @@ -19,7 +20,18 @@ public IRecipeWrapper createAnvilRecipe(ItemStack leftInput, List rig ErrorUtil.checkNotEmpty(outputs, "outputs"); Preconditions.checkArgument(rightInputs.size() == outputs.size(), "Input and output sizes must match."); - return new AnvilRecipeWrapper(leftInput, rightInputs, outputs); + return new AnvilRecipeWrapper(Collections.singletonList(leftInput), rightInputs, outputs); + } + + @Override + public IRecipeWrapper createAnvilRecipe(List leftInputs, List rightInputs, List outputs) { + ErrorUtil.checkNotEmpty(leftInputs, "leftInput"); + ErrorUtil.checkNotEmpty(rightInputs, "rightInputs"); + ErrorUtil.checkNotEmpty(outputs, "outputs"); + Preconditions.checkArgument(leftInputs.size() == rightInputs.size(), "Both input sizes must match."); + Preconditions.checkArgument(rightInputs.size() == outputs.size(), "Input and output sizes must match."); + + return new AnvilRecipeWrapper(leftInputs, rightInputs, outputs); } @Override diff --git a/src/main/java/mezz/jei/plugins/vanilla/anvil/AnvilRecipeWrapper.java b/src/main/java/mezz/jei/plugins/vanilla/anvil/AnvilRecipeWrapper.java index a6cb5b7e3..f023c67ba 100644 --- a/src/main/java/mezz/jei/plugins/vanilla/anvil/AnvilRecipeWrapper.java +++ b/src/main/java/mezz/jei/plugins/vanilla/anvil/AnvilRecipeWrapper.java @@ -27,9 +27,9 @@ public class AnvilRecipeWrapper implements IRecipeWrapper { private ItemStack lastRightStack; private int lastCost; - public AnvilRecipeWrapper(ItemStack leftInput, List rightInputs, List outputs) { + public AnvilRecipeWrapper(List leftInput, List rightInputs, List outputs) { this.inputs = Lists.newArrayList(); - this.inputs.add(Collections.singletonList(leftInput)); + this.inputs.add(leftInput); this.inputs.add(rightInputs); this.output = Collections.singletonList(outputs); diff --git a/src/main/java/mezz/jei/startup/ModRegistry.java b/src/main/java/mezz/jei/startup/ModRegistry.java index 4a4b6cd10..d797befc2 100644 --- a/src/main/java/mezz/jei/startup/ModRegistry.java +++ b/src/main/java/mezz/jei/startup/ModRegistry.java @@ -296,7 +296,7 @@ public void addAnvilRecipe(ItemStack leftInput, List rightInputs, Lis ErrorUtil.checkNotEmpty(outputs, "outputs"); Preconditions.checkArgument(rightInputs.size() == outputs.size(), "Input and output sizes must match."); - AnvilRecipeWrapper anvilRecipeWrapper = new AnvilRecipeWrapper(leftInput, rightInputs, outputs); + AnvilRecipeWrapper anvilRecipeWrapper = new AnvilRecipeWrapper(Collections.singletonList(leftInput), rightInputs, outputs); addRecipes(Collections.singletonList(anvilRecipeWrapper), VanillaRecipeCategoryUid.ANVIL); }