From 66e60655bf823950bb2ce76807df1d46fdc03a91 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 7 Oct 2018 21:20:18 +0100 Subject: [PATCH] Work towards https://github.com/TechReborn/TechReborn/issues/1614 still need to move all the other recipes that need it to use the ore dict --- .../java/techreborn/compat/jei/BaseRecipeWrapper.java | 3 +++ .../techreborn/init/recipes/AlloySmelterRecipes.java | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java b/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java index 5583cfe1b..4b8492f27 100644 --- a/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java @@ -29,6 +29,7 @@ import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import reborncore.common.recipes.IRecipeInput; import techreborn.api.recipe.BaseRecipe; import javax.annotation.Nonnull; @@ -57,6 +58,8 @@ public abstract class BaseRecipeWrapper implements IRecipe } } else if (input instanceof String) { inputs.add(OreDictionary.getOres((String) input)); + } else if (input instanceof IRecipeInput){ + inputs.add(((IRecipeInput) input).getAllStacks()); } } for (ItemStack input : baseRecipe.getOutputs()) { diff --git a/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java b/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java index ac34aeaf3..ad6b0ca03 100644 --- a/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java +++ b/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java @@ -28,6 +28,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import reborncore.api.recipe.RecipeHandler; +import reborncore.common.recipes.OreRecipeInput; import reborncore.common.util.OreUtil; import techreborn.api.recipe.machines.AlloySmelterRecipe; import techreborn.items.ingredients.ItemDusts; @@ -42,16 +43,16 @@ public class AlloySmelterRecipes extends RecipeMethods { public static void init() { // Bronze RecipeHandler.addRecipe( - new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemIngots.getIngotByName("tin", 1), + new AlloySmelterRecipe(new OreRecipeInput("ingotCopper", 3), "ingotTin", ItemIngots.getIngotByName("bronze", 4), 200, 16)); RecipeHandler.addRecipe( - new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemDusts.getDustByName("tin", 1), + new AlloySmelterRecipe(new OreRecipeInput("ingotCopper", 3), "dustTin", ItemIngots.getIngotByName("bronze", 4), 200, 16)); RecipeHandler.addRecipe( - new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemIngots.getIngotByName("tin", 1), + new AlloySmelterRecipe(new OreRecipeInput("dustCopper", 3), "ingotTin", ItemIngots.getIngotByName("bronze", 4), 200, 16)); RecipeHandler.addRecipe( - new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemDusts.getDustByName("tin", 1), + new AlloySmelterRecipe(new OreRecipeInput("dustCopper", 3), "dustTin", ItemIngots.getIngotByName("bronze", 4), 200, 16)); // Electrum