diff --git a/src/main/java/WayofTime/bloodmagic/api/registry/AlchemyArrayRecipeRegistry.java b/src/main/java/WayofTime/bloodmagic/api/registry/AlchemyArrayRecipeRegistry.java index 7a33878c..03465dd5 100644 --- a/src/main/java/WayofTime/bloodmagic/api/registry/AlchemyArrayRecipeRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/api/registry/AlchemyArrayRecipeRegistry.java @@ -11,21 +11,24 @@ import lombok.Getter; import lombok.ToString; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.oredict.OreDictionary; import javax.annotation.Nullable; +import java.util.Collections; +import java.util.List; import java.util.Map.Entry; public class AlchemyArrayRecipeRegistry { public static final AlchemyCircleRenderer defaultRenderer = new AlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/BaseArray.png")); - private static BiMap recipes = HashBiMap.create(); + private static BiMap, AlchemyArrayRecipe> recipes = HashBiMap.create(); /** * General case for creating an AlchemyArrayEffect for a given input. * - * @param inputStack - * - Input item that is used to change the Alchemy Circle into the + * @param input + * - Input item(s) that is used to change the Alchemy Circle into the * circle that you are making * @param catalystStack * - Catalyst item that, when right-clicked onto the array, will @@ -36,18 +39,19 @@ public class AlchemyArrayRecipeRegistry * - Circle rendered when the array is passive - can be substituted * for a special renderer */ - public static void registerRecipe(ItemStack inputStack, @Nullable ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) + public static void registerRecipe(List input, @Nullable ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) { - for (Entry entry : recipes.entrySet()) + for (Entry, AlchemyArrayRecipe> entry : recipes.entrySet()) { AlchemyArrayRecipe arrayRecipe = entry.getValue(); - if (arrayRecipe.doesInputMatchRecipe(inputStack)) + if (arrayRecipe.doesInputMatchRecipe(input)) { AlchemyArrayEffect eff = arrayRecipe.getAlchemyArrayEffectForCatalyst(catalystStack); if (eff != null) { return; // Recipe already exists! - } else + } + else { arrayRecipe.catalystMap.put(ItemStackWrapper.getHolder(catalystStack), arrayEffect); if (circleRenderer != null) @@ -59,114 +63,195 @@ public class AlchemyArrayRecipeRegistry if (circleRenderer == null) { - recipes.put(ItemStackWrapper.getHolder(inputStack), new AlchemyArrayRecipe(inputStack, catalystStack, arrayEffect, defaultRenderer)); - } else + recipes.put(input, new AlchemyArrayRecipe(input, catalystStack, arrayEffect, defaultRenderer)); + } + else { - recipes.put(ItemStackWrapper.getHolder(inputStack), new AlchemyArrayRecipe(inputStack, catalystStack, arrayEffect, circleRenderer)); + recipes.put(input, new AlchemyArrayRecipe(input, catalystStack, arrayEffect, circleRenderer)); } - recipes.put(ItemStackWrapper.getHolder(inputStack), new AlchemyArrayRecipe(inputStack, catalystStack, arrayEffect, circleRenderer)); + recipes.put(input, new AlchemyArrayRecipe(input, catalystStack, arrayEffect, circleRenderer)); } - public static void registerCraftingRecipe(ItemStack inputStack, ItemStack catalystStack, ItemStack outputStack, AlchemyCircleRenderer circleRenderer) + public static void registerCraftingRecipe(ItemStack input, ItemStack catalystStack, ItemStack outputStack, ResourceLocation arrayResource) { - registerRecipe(inputStack, catalystStack, new AlchemyArrayEffectCrafting(outputStack), circleRenderer); + registerRecipe(input, catalystStack, new AlchemyArrayEffectCrafting(outputStack), arrayResource); } - public static void registerCraftingRecipe(ItemStack inputStack, ItemStack catalystStack, ItemStack outputStack, ResourceLocation arrayResource) + public static void registerCraftingRecipe(List inputStacks, ItemStack catalystStack, ItemStack outputStack, ResourceLocation arrayResource) { - registerRecipe(inputStack, catalystStack, new AlchemyArrayEffectCrafting(outputStack), arrayResource); + registerRecipe(inputStacks, catalystStack, new AlchemyArrayEffectCrafting(outputStack), arrayResource); } - public static void registerCraftingRecipe(ItemStack inputStack, ItemStack catalystStack, ItemStack outputStack) + public static void registerCraftingRecipe(String inputOreDict, ItemStack catalystStack, ItemStack outputStack, ResourceLocation arrayResource) { - registerRecipe(inputStack, catalystStack, new AlchemyArrayEffectCrafting(outputStack)); + if (OreDictionary.doesOreNameExist(inputOreDict)) + registerRecipe(OreDictionary.getOres(inputOreDict), catalystStack, new AlchemyArrayEffectCrafting(outputStack), arrayResource); } - public static void registerRecipe(ItemStack inputStack, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) + public static void registerCraftingRecipe(ItemStack input, ItemStack catalystStack, ItemStack outputStack) + { + registerRecipe(input, catalystStack, new AlchemyArrayEffectCrafting(outputStack)); + } + + public static void registerCraftingRecipe(List inputStacks, ItemStack catalystStack, ItemStack outputStack) + { + registerRecipe(inputStacks, catalystStack, new AlchemyArrayEffectCrafting(outputStack)); + } + + public static void registerCraftingRecipe(String inputOreDict, ItemStack catalystStack, ItemStack outputStack) + { + if (OreDictionary.doesOreNameExist(inputOreDict)) + registerRecipe(OreDictionary.getOres(inputOreDict), catalystStack, new AlchemyArrayEffectCrafting(outputStack)); + } + + public static void registerRecipe(ItemStack inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) { AlchemyCircleRenderer circleRenderer = arrayResource == null ? defaultRenderer : new AlchemyCircleRenderer(arrayResource); - registerRecipe(inputStack, catalystStack, arrayEffect, circleRenderer); + registerRecipe(Collections.singletonList(inputStacks), catalystStack, arrayEffect, circleRenderer); } - public static void registerRecipe(ItemStack inputStack, ItemStack catalystStack, AlchemyArrayEffect arrayEffect) + public static void registerRecipe(ItemStack inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) { - registerRecipe(inputStack, catalystStack, arrayEffect, (AlchemyCircleRenderer) null); + registerRecipe(Collections.singletonList(inputStacks), catalystStack, arrayEffect, circleRenderer); } - public static void replaceAlchemyCircle(ItemStack inputStack, AlchemyCircleRenderer circleRenderer) + public static void registerRecipe(List inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) + { + AlchemyCircleRenderer circleRenderer = arrayResource == null ? defaultRenderer : new AlchemyCircleRenderer(arrayResource); + registerRecipe(inputStacks, catalystStack, arrayEffect, circleRenderer); + } + + public static void registerRecipe(String inputOreDict, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) + { + if (OreDictionary.doesOreNameExist(inputOreDict)) + { + AlchemyCircleRenderer circleRenderer = arrayResource == null ? defaultRenderer : new AlchemyCircleRenderer(arrayResource); + registerRecipe(OreDictionary.getOres(inputOreDict), catalystStack, arrayEffect, circleRenderer); + } + } + + public static void registerRecipe(ItemStack input, ItemStack catalystStack, AlchemyArrayEffect arrayEffect) + { + registerRecipe(Collections.singletonList(input), catalystStack, arrayEffect, (AlchemyCircleRenderer) null); + } + + public static void registerRecipe(List inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect) + { + registerRecipe(inputStacks, catalystStack, arrayEffect, (AlchemyCircleRenderer) null); + } + + public static void registerRecipe(String inputOreDict, ItemStack catalystStack, AlchemyArrayEffect arrayEffect) + { + if (OreDictionary.doesOreNameExist(inputOreDict)) + registerRecipe(OreDictionary.getOres(inputOreDict), catalystStack, arrayEffect, (AlchemyCircleRenderer) null); + } + + public static void replaceAlchemyCircle(List input, AlchemyCircleRenderer circleRenderer) { if (circleRenderer == null) return; - for (Entry entry : recipes.entrySet()) + for (Entry, AlchemyArrayRecipe> entry : recipes.entrySet()) { AlchemyArrayRecipe arrayRecipe = entry.getValue(); - if (arrayRecipe.doesInputMatchRecipe(inputStack)) + if (arrayRecipe.doesInputMatchRecipe(input)) arrayRecipe.circleRenderer = circleRenderer; } } - public static AlchemyArrayRecipe getRecipeForInput(ItemStack input) + public static AlchemyArrayRecipe getRecipeForInput(List input) { - return recipes.get(ItemStackWrapper.getHolder(input)); + return recipes.get(input); } - public static AlchemyArrayEffect getAlchemyArrayEffect(ItemStack inputStack, @Nullable ItemStack catalystStack) + public static AlchemyArrayEffect getAlchemyArrayEffect(List input, @Nullable ItemStack catalystStack) { - for (Entry entry : recipes.entrySet()) + for (Entry, AlchemyArrayRecipe> entry : recipes.entrySet()) { AlchemyArrayRecipe arrayRecipe = entry.getValue(); - if (ItemStackWrapper.getHolder(arrayRecipe.getInputStack()).equals(ItemStackWrapper.getHolder(inputStack))) - return arrayRecipe.getAlchemyArrayEffectForCatalyst(catalystStack); // TODO: Decide if a copy should be returned. + if (input.size() == 1 && arrayRecipe.getInput().size() == 1) + { + if (ItemStackWrapper.getHolder(arrayRecipe.getInput().get(0)).equals(ItemStackWrapper.getHolder(input.get(0)))) + return arrayRecipe.getAlchemyArrayEffectForCatalyst(catalystStack); // TODO: Decide if a copy should be returned. + } + else + { + if (input.equals(arrayRecipe.getInput())) + return arrayRecipe.getAlchemyArrayEffectForCatalyst(catalystStack); + } } return null; } - public static AlchemyCircleRenderer getAlchemyCircleRenderer(ItemStack inputStack) + public static AlchemyArrayEffect getAlchemyArrayEffect(ItemStack input, @Nullable ItemStack catalystStack) { - for (Entry entry : recipes.entrySet()) + return getAlchemyArrayEffect(Collections.singletonList(input), catalystStack); + } + + public static AlchemyCircleRenderer getAlchemyCircleRenderer(List input) + { + for (Entry, AlchemyArrayRecipe> entry : recipes.entrySet()) { AlchemyArrayRecipe arrayRecipe = entry.getValue(); - if (arrayRecipe.doesInputMatchRecipe(inputStack)) + if (arrayRecipe.doesInputMatchRecipe(input)) return arrayRecipe.circleRenderer; } return defaultRenderer; } + public static AlchemyCircleRenderer getAlchemyCircleRenderer(ItemStack itemStack) + { + return getAlchemyCircleRenderer(Collections.singletonList(itemStack)); + } + @Getter @ToString @EqualsAndHashCode public static class AlchemyArrayRecipe { - public AlchemyCircleRenderer circleRenderer; - public final ItemStack inputStack; + public final List input; public final BiMap catalystMap = HashBiMap.create(); - public AlchemyArrayRecipe(ItemStack inputStack, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) + private AlchemyArrayRecipe(List input, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer, boolean useless) { - this.inputStack = inputStack; + this.input = input; catalystMap.put(ItemStackWrapper.getHolder(catalystStack), arrayEffect); this.circleRenderer = circleRenderer; } - /** - * Compares the inputed ItemStack to see if it matches with the recipe's - * inputStack. - * - * @param comparedStack - * - The stack to compare with - * - * @return - True if the ItemStack is a compatible item - */ - public boolean doesInputMatchRecipe(ItemStack comparedStack) + public AlchemyArrayRecipe(ItemStack inputStack, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) { - return !(comparedStack == null || this.inputStack == null) && this.inputStack.isItemEqual(comparedStack); + this(Collections.singletonList(inputStack), catalystStack, arrayEffect, circleRenderer, false); + } + + public AlchemyArrayRecipe(String inputOreDict, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) + { + this(OreDictionary.getOres(inputOreDict), catalystStack, arrayEffect, circleRenderer, false); + } + + public AlchemyArrayRecipe(List inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) + { + this(inputStacks, catalystStack, arrayEffect, circleRenderer, false); + } + + /** + * Compares the inputed list of ItemStacks to see if it matches with the recipe's + * list. + * + * @param comparedList + * - The list to compare with + * + * @return - True if the ItemStack(s) is a compatible item + */ + public boolean doesInputMatchRecipe(List comparedList) + { + return !(comparedList == null || this.input == null) && (this.input.size() == 1 && comparedList.size() == 1 ? this.input.get(0).isItemEqual(comparedList.get(0)) : this.input.equals(comparedList)); } /** @@ -197,7 +282,7 @@ public class AlchemyArrayRecipeRegistry } } - public static BiMap getRecipes() + public static BiMap, AlchemyArrayRecipe> getRecipes() { return HashBiMap.create(recipes); } diff --git a/src/main/java/WayofTime/bloodmagic/api/registry/AltarRecipeRegistry.java b/src/main/java/WayofTime/bloodmagic/api/registry/AltarRecipeRegistry.java index 3ead6593..1ada0d3a 100644 --- a/src/main/java/WayofTime/bloodmagic/api/registry/AltarRecipeRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/api/registry/AltarRecipeRegistry.java @@ -8,19 +8,30 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; -import javax.annotation.Nullable; +import java.util.Collections; +import java.util.List; public class AltarRecipeRegistry { - private static BiMap recipes = HashBiMap.create(); + private static BiMap, AltarRecipe> recipes = HashBiMap.create(); - public static void registerRecipe(AltarRecipe recipe) + /** + * Registers an {@link AltarRecipe} for the Blood Altar. This can be a {@code ItemStack}, {@code List}, + * or {@code String} OreDictionary entry. + * + * If the OreDictionary entry does not exist or is empty, it will not be registered. + * + * @param altarRecipe + * - The AltarRecipe to register + */ + public static void registerRecipe(AltarRecipe altarRecipe) { - if (!recipes.containsValue(recipe)) - recipes.put(recipe.input, recipe); + if (!recipes.containsValue(altarRecipe) && altarRecipe.getInput().size() > 0) + recipes.put(altarRecipe.getInput(), altarRecipe); else - BloodMagicAPI.getLogger().error("Error adding altar recipe for %s. Recipe already exists.", recipe.input.getDisplayName(), recipe.output == null ? "" : " -> "); + BloodMagicAPI.getLogger().error("Error adding altar recipe for input [{}].", altarRecipe.toString()); } public static void registerFillRecipe(ItemStack orbStack, EnumAltarTier tier, int maxForOrb, int consumeRate, int drainRate) @@ -28,9 +39,24 @@ public class AltarRecipeRegistry registerRecipe(new AltarRecipe(orbStack, orbStack, tier, maxForOrb, consumeRate, drainRate, true)); } - public static AltarRecipe getRecipeForInput(ItemStack input) + /** + * Gets the recipe that the provided input is registered to. + * + * @param input + * - The input ItemStack to get the recipe for + * @return - The recipe that the provided input is registered to. + */ + public static AltarRecipe getRecipeForInput(List input) { - return recipes.get(input); + if (recipes.keySet().contains(input)) + return recipes.get(input); + + return null; + } + + public static BiMap, AltarRecipe> getRecipes() + { + return HashBiMap.create(recipes); } @Getter @@ -38,11 +64,11 @@ public class AltarRecipeRegistry @EqualsAndHashCode public static class AltarRecipe { - - public final int syphon, consumeRate, drainRate; - public final boolean fillable; - public final ItemStack input, output; - public final EnumAltarTier minTier; + private final List input; + private final ItemStack output; + private final EnumAltarTier minTier; + private final int syphon, consumeRate, drainRate; + private final boolean fillable; /** * Allows creation of a recipe for the @@ -50,7 +76,7 @@ public class AltarRecipeRegistry * {@link WayofTime.bloodmagic.tile.TileAltar}. The output ItemStack is * allowed to be null as some recipes do not contain an output. (Blood * Orbs) - * + * * @param input * - The input ItemStack * @param output @@ -66,7 +92,7 @@ public class AltarRecipeRegistry * @param fillable * - Whether the input item can be filled with LP. IE: Orbs */ - public AltarRecipe(ItemStack input, @Nullable ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean fillable) + public AltarRecipe(List input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean fillable) { this.input = input; this.output = output; @@ -77,23 +103,44 @@ public class AltarRecipeRegistry this.fillable = fillable; } - public AltarRecipe(ItemStack input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) + public AltarRecipe(List input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) { this(input, output, minTier, syphon, consumeRate, drainRate, false); } + public AltarRecipe(ItemStack input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean fillable) + { + this(Collections.singletonList(input), output, minTier, syphon, consumeRate, drainRate, fillable); + } + + public AltarRecipe(ItemStack input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) + { + this(Collections.singletonList(input), output, minTier, syphon, consumeRate, drainRate, false); + } + + public AltarRecipe(String inputEntry, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean fillable) + { + this(OreDictionary.doesOreNameExist(inputEntry) && OreDictionary.getOres(inputEntry).size() > 0 ? OreDictionary.getOres(inputEntry) : Collections.emptyList(), output, minTier, syphon, consumeRate, drainRate, fillable); + } + + public AltarRecipe(String inputEntry, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) + { + this(OreDictionary.doesOreNameExist(inputEntry) && OreDictionary.getOres(inputEntry).size() > 0 ? OreDictionary.getOres(inputEntry) : Collections.emptyList(), output, minTier, syphon, consumeRate, drainRate, false); + } + public boolean doesRequiredItemMatch(ItemStack comparedStack, EnumAltarTier tierCheck) { if (comparedStack == null || this.input == null) return false; - return tierCheck.ordinal() >= minTier.ordinal() && this.input.isItemEqual(comparedStack);// && - // (this.fillable this.areRequiredTagsEqual(comparedStack) : true); + if (tierCheck.ordinal() < minTier.ordinal()) + return false; + + for (ItemStack stack : input) + if (comparedStack.isItemEqual(stack)) + return true; + + return false; } } - - public static BiMap getRecipes() - { - return HashBiMap.create(recipes); - } -} +} \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java index 59d8a10e..b9316436 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java @@ -7,7 +7,6 @@ import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin; @@ -61,16 +60,15 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory @SuppressWarnings("unchecked") public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5); - recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 50, 5); + recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3); recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5); if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI) { AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper; - recipeLayout.getItemStacks().set(INPUT_SLOT, (ItemStack) alchemyArrayWrapper.getInputs().get(0)); - recipeLayout.getItemStacks().set(CATALYST_SLOT, (ItemStack) alchemyArrayWrapper.getInputs().get(1)); + recipeLayout.getItemStacks().set(INPUT_SLOT, alchemyArrayWrapper.getInputs().subList(0, alchemyArrayWrapper.getInputs().size() - 1)); + recipeLayout.getItemStacks().set(CATALYST_SLOT, alchemyArrayWrapper.getCatalyst()); recipeLayout.getItemStacks().set(OUTPUT_SLOT, alchemyArrayWrapper.getOutputs()); } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java index 9e307a28..a9349c72 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java @@ -13,22 +13,31 @@ import net.minecraft.item.ItemStack; public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper { @Nonnull - private final List inputs; + private final Object inputs; + + @Nullable + private final ItemStack catalyst; @Nonnull private final ItemStack output; @SuppressWarnings("unchecked") - public AlchemyArrayCraftingRecipeJEI(@Nonnull ItemStack input, @Nullable ItemStack catalyst, @Nonnull ItemStack output) + public AlchemyArrayCraftingRecipeJEI(@Nonnull List input, @Nullable ItemStack catalyst, @Nonnull ItemStack output) { - this.inputs = Arrays.asList(input, catalyst); + this.inputs = input; + this.catalyst = catalyst; this.output = output; } @Override public List getInputs() { - return inputs; + return Arrays.asList(inputs, catalyst); + } + + public ItemStack getCatalyst() + { + return catalyst; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeMaker.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeMaker.java index 423ceb2a..ad94d56e 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeMaker.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeMaker.java @@ -19,13 +19,13 @@ public class AlchemyArrayCraftingRecipeMaker @Nonnull public static List getRecipes() { - Map alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes(); + Map, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes(); ArrayList recipes = new ArrayList(); - for (Map.Entry itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) + for (Map.Entry, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) { - ItemStack input = itemStackAlchemyArrayRecipeEntry.getValue().getInputStack(); + List input = itemStackAlchemyArrayRecipeEntry.getValue().getInput(); BiMap catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap; for (Map.Entry entry : catalystMap.entrySet()) diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java index c0bcb49c..4fea3cbc 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java @@ -16,7 +16,7 @@ import WayofTime.bloodmagic.util.helper.TextHelper; public class AltarRecipeJEI extends BlankRecipeWrapper { @Nonnull - private final ItemStack input; + private final Object input; @Nonnull private final ItemStack output; @@ -25,7 +25,7 @@ public class AltarRecipeJEI extends BlankRecipeWrapper private final int consumptionRate; private final int drainRate; - public AltarRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output, int tier, int requiredLP, int consumptionRate, int drainRate) + public AltarRecipeJEI(@Nonnull List input, @Nonnull ItemStack output, int tier, int requiredLP, int consumptionRate, int drainRate) { this.input = input; this.output = output; diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeMaker.java b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeMaker.java index a41f6dce..0e450e7b 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeMaker.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeMaker.java @@ -15,16 +15,16 @@ public class AltarRecipeMaker @Nonnull public static List getRecipes() { - Map altarMap = AltarRecipeRegistry.getRecipes(); + Map, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes(); ArrayList recipes = new ArrayList(); - for (Map.Entry itemStackAltarRecipeEntry : altarMap.entrySet()) + for (Map.Entry, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet()) { - if (!(itemStackAltarRecipeEntry.getKey().getItem() instanceof IBloodOrb)) + // Make sure input is not a Blood Orb. If it is, the recipe is for a filling orb, and we don't want that. + if (!(itemStackAltarRecipeEntry.getKey().get(0).getItem() instanceof IBloodOrb)) { - // Make sure input is not a Blood Orb. If it is, the recipe is for a filling orb, and we don't want that. - ItemStack input = itemStackAltarRecipeEntry.getKey(); + List input = itemStackAltarRecipeEntry.getValue().getInput(); ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput(); int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt(); int requiredLP = itemStackAltarRecipeEntry.getValue().getSyphon(); diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java index 66312e58..cc341cd1 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java @@ -61,16 +61,15 @@ public class BindingRecipeCategory implements IRecipeCategory @SuppressWarnings("unchecked") public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5); - recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 50, 5); + recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3); recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5); if (recipeWrapper instanceof BindingRecipeJEI) { BindingRecipeJEI bindingRecipe = (BindingRecipeJEI) recipeWrapper; - recipeLayout.getItemStacks().set(INPUT_SLOT, (ItemStack) bindingRecipe.getInputs().get(0)); - recipeLayout.getItemStacks().set(CATALYST_SLOT, (ItemStack) bindingRecipe.getInputs().get(1)); + recipeLayout.getItemStacks().set(INPUT_SLOT, bindingRecipe.getInputs()); + recipeLayout.getItemStacks().set(CATALYST_SLOT, bindingRecipe.getCatalyst()); recipeLayout.getItemStacks().set(OUTPUT_SLOT, bindingRecipe.getOutputs()); } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java index 22f33019..083bc2aa 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java @@ -14,20 +14,29 @@ public class BindingRecipeJEI extends BlankRecipeWrapper @Nonnull private final List inputs; + @Nonnull + private final ItemStack catalyst; + @Nonnull private final ItemStack output; @SuppressWarnings("unchecked") - public BindingRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output) + public BindingRecipeJEI(@Nonnull List input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output) { - this.inputs = Arrays.asList(input, catalyst); + this.inputs = input; + this.catalyst = catalyst; this.output = output; } @Override public List getInputs() { - return inputs; + return Arrays.asList(inputs, catalyst); + } + + public ItemStack getCatalyst() + { + return catalyst; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java index 93bcd6e9..2632cf9d 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java @@ -19,13 +19,13 @@ public class BindingRecipeMaker @Nonnull public static List getRecipes() { - Map alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes(); + Map, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes(); ArrayList recipes = new ArrayList(); - for (Map.Entry itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) + for (Map.Entry, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) { - ItemStack input = itemStackAlchemyArrayRecipeEntry.getValue().getInputStack(); + List input = itemStackAlchemyArrayRecipeEntry.getValue().getInput(); BiMap catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap; for (Map.Entry entry : catalystMap.entrySet()) diff --git a/src/main/resources/assets/bloodmagic/gui/jei/binding.png b/src/main/resources/assets/bloodmagic/gui/jei/binding.png index 21502771..390049da 100644 Binary files a/src/main/resources/assets/bloodmagic/gui/jei/binding.png and b/src/main/resources/assets/bloodmagic/gui/jei/binding.png differ