From 800ffa213b2f52e0275fd6417a88521d4feca107 Mon Sep 17 00:00:00 2001 From: Arcaratus Date: Fri, 25 Mar 2016 10:07:30 -0400 Subject: [PATCH] OreDict Altar Recipes! OreDict support for altar and alchemy array recipes! Changed the alchemy array JEI image Recipe modularizations Fix Like this? Tehnut patch Change to List --- .../registry/AlchemyArrayRecipeRegistry.java | 183 +++++++++++++----- .../api/registry/AltarRecipeRegistry.java | 95 ++++++--- .../AlchemyArrayCraftingCategory.java | 8 +- .../AlchemyArrayCraftingRecipeJEI.java | 17 +- .../AlchemyArrayCraftingRecipeMaker.java | 6 +- .../compat/jei/altar/AltarRecipeJEI.java | 4 +- .../compat/jei/altar/AltarRecipeMaker.java | 10 +- .../jei/binding/BindingRecipeCategory.java | 7 +- .../compat/jei/binding/BindingRecipeJEI.java | 15 +- .../jei/binding/BindingRecipeMaker.java | 6 +- .../assets/bloodmagic/gui/jei/binding.png | Bin 16145 -> 868 bytes 11 files changed, 249 insertions(+), 102 deletions(-) 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 21502771f382cf6bd41dd86cb5431772a346d1da..390049dab957c30005694935c91a5f0d4d4375f9 100644 GIT binary patch literal 868 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$6&6|H(?D8gCb z5m^k>u>ph`Yf~eC0R`DhJbhi+A23VuTS_dO+GxhW!1U46#WAGf*4w)WI}aNOI0S0$ zP?3-6;Ma3W^*Mj)s3J=dhuIC6&vBewpCvPIF8OwkJO8sye3`=SZBwsBmA<-@TEudn z{WI5E)AqA#<@y*{7z7v;u1X)+q_bRp@3qpeGg$viG+bwx|Im;-hEY#c(9ZV6A2tQ1 z2^I`W3@4d^3>zThxQ{Y#zRQnpmXtdTIZO%+W(+^JYaf`nu(u=5Yh|1Kr#yzcADrK5 zJDC5O@PjvDKOci6P-npzlS>EOT)yX@oKV2Lf%8BkZ^D10{)b8l!VU6F1=kly1Qf7> zo%7(9IfMI$%>O&}*d4j9<}){GGbk`L0DaEDK_v$DOoF>;)JW=u0E$TlbJR^mJT_lm TvC|ir9~eAc{an^LB{Ts5mDHpS literal 16145 zcmeI3UuYaf9LFbZscEEIQ4j=SdsVQ|z5R2$o4fVy+9sDKQLl~3NfRvEz1`Vl$=&UF zyUAUGZ9^+9LJ_g0`qCF4q%YNi2-S+U#iCF_MfxIIgj%pg+9JNFlsdb6e>RiL5H%vo z93;2D`OWY9+xg7QZ}uMc<)Q8UYr7um0syQX9LNj<(19*HK<8@owX1T%L|<#l17i;I zpYr}X_Q0{<0C@a_l^bYBjdxYzRae zIvMEb6|3x8c8T$HwY)v$rXmq9QS(zDSFzkoRC4O<5Jj%0l{q2GbM1l*y%|%UsucWN zGjt9XU=fyF2gM0(LNErz$$^n?^&~&~EguWws_~o|5NT^xk33S|rT#1Y!PC2xcgW#;W#Kpyt|@oNX7< z!73YSAY^)b{Z++0w$myZcGcOKe7va<>WOQh{bOjZwj`Bs-;j=>tEOEkYHr#pYU7YA zm&TJ^t1;BGxvJD&yI@z)ZNYRb$+c?^MfodD9V|JnR?^{MCXE`RmSw1>tQ)2tkF$cV z8*JQ=@@zsEO%_UWUJ&_&#%qcXF`EsCFObgI`jod@kaSR33|mL?t=lq911eBK@(G1! z1p&%zT$6Ryl=2BdQuw%$FdB(MVha-Os931(X@yW9Z!88%me65diHVSvO+{u!Q4-m_ z&hu(W|Limb6{=g6WmQfzD%8I>4XstIPiUoaXr#Hu$Qlj*rI}k=J^X7M zsO{PEKbW~-C(f^ljZ(g_h9e5L0fCh1pP<7I$D_W`^OVJ`f!5x zzaAQPkLfV2$Z||ha(FWyF=W+XVKif* z6V&le0#QZ>l^=wA+D48o8X5A`BZJ8bJyQGiGiXH*?C7@w*Zi@tptLqmpyj-14QV-5 zF)f+|141?_E;1j?OL1X9$R@=_=7V`DE({3Sq`1g@FfYZ00U?_d7nu*{rMNI4WRv0| z^TE6n7Y2lEQe0#{n3v+hfRIg!i_8b}Qd}4ivPp4~`Cwj(3j;znDK0V}%u8`$K*%P= zMdpKfDJ~2M*`&D0d@wJ?g#jU(6c?Ef=B2nWAY_x`BJ;t#6c+}BY*JigKA4x{!hn!X zii^w#^HN+G5VA>ek@;X=iVFimHYqMLAIwW}VL-?x#YN_Wc_}Uo2-&2#$b2v_#f1SO zn?zh)t=Dg13B7Y$MK9N$srGI|FXl4(z;G6T*+&7GI{?71chL7W0H$~VuI~mweFK08 z?bn{afcmbuGML$#t9|p+cjwj|*z!Q%(`%3YaK2~P=x0ZT)DGn!b9#8_m*XSn5AC~h zc>T3!Cm-H-CH|c9DjfS@_zC;^w~*g|`@)Ak8!w!C|I(+OTf7&F-@F0dveZ4-8(Ll<}TgYRF`ZVUGwnfnCPj;`(p zesb{!IJ|rE_L=Abrsw9_j&t{cb%A5mGF^0l