From 08f865ba8a9811e926f483c263844e975a1f8acc Mon Sep 17 00:00:00 2001 From: Nicholas Ignoffo Date: Sun, 1 May 2016 09:10:12 -0700 Subject: [PATCH] Fix JEI support for orb recipes with more than 1 orb --- .../compat/jei/orb/ShapedOrbRecipeJEI.java | 15 +-------------- .../compat/jei/orb/ShapelessOrbRecipeJEI.java | 15 +-------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java index 065a0bd6..840e59ff 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java @@ -31,23 +31,10 @@ public class ShapedOrbRecipeJEI implements IShapedCraftingRecipeWrapper public ShapedOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output) { ArrayList inputList = new ArrayList(input); - int replaceIndex = 0; - Object toReplace = null; for (Object object : inputList) - { if (object instanceof Integer) - { - replaceIndex = inputList.indexOf(object); - toReplace = object; - } - } - - if (toReplace != null) - { - inputList.remove(replaceIndex); - inputList.add(replaceIndex, OrbRegistry.getOrbsDownToTier((Integer) toReplace)); - } + inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object)); this.inputs = inputList; this.tier = tier; diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java index 336cef7b..dc16002d 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java @@ -31,23 +31,10 @@ public class ShapelessOrbRecipeJEI implements ICraftingRecipeWrapper public ShapelessOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output) { ArrayList inputList = new ArrayList(input); - int replaceIndex = 0; - Object toReplace = null; for (Object object : inputList) - { if (object instanceof Integer) - { - replaceIndex = inputList.indexOf(object); - toReplace = object; - } - } - - if (toReplace != null) - { - inputList.remove(replaceIndex); - inputList.add(replaceIndex, OrbRegistry.getOrbsDownToTier((Integer) toReplace)); - } + inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object)); this.inputs = inputList; this.tier = tier;