Fix JEI support for orb recipes with more than 1 orb
This commit is contained in:
parent
8283047bf1
commit
08f865ba8a
2 changed files with 2 additions and 28 deletions
|
@ -31,23 +31,10 @@ public class ShapedOrbRecipeJEI implements IShapedCraftingRecipeWrapper
|
||||||
public ShapedOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
public ShapedOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
||||||
{
|
{
|
||||||
ArrayList inputList = new ArrayList(input);
|
ArrayList inputList = new ArrayList(input);
|
||||||
int replaceIndex = 0;
|
|
||||||
Object toReplace = null;
|
|
||||||
|
|
||||||
for (Object object : inputList)
|
for (Object object : inputList)
|
||||||
{
|
|
||||||
if (object instanceof Integer)
|
if (object instanceof Integer)
|
||||||
{
|
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
|
||||||
replaceIndex = inputList.indexOf(object);
|
|
||||||
toReplace = object;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toReplace != null)
|
|
||||||
{
|
|
||||||
inputList.remove(replaceIndex);
|
|
||||||
inputList.add(replaceIndex, OrbRegistry.getOrbsDownToTier((Integer) toReplace));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inputs = inputList;
|
this.inputs = inputList;
|
||||||
this.tier = tier;
|
this.tier = tier;
|
||||||
|
|
|
@ -31,23 +31,10 @@ public class ShapelessOrbRecipeJEI implements ICraftingRecipeWrapper
|
||||||
public ShapelessOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
public ShapelessOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
||||||
{
|
{
|
||||||
ArrayList inputList = new ArrayList(input);
|
ArrayList inputList = new ArrayList(input);
|
||||||
int replaceIndex = 0;
|
|
||||||
Object toReplace = null;
|
|
||||||
|
|
||||||
for (Object object : inputList)
|
for (Object object : inputList)
|
||||||
{
|
|
||||||
if (object instanceof Integer)
|
if (object instanceof Integer)
|
||||||
{
|
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
|
||||||
replaceIndex = inputList.indexOf(object);
|
|
||||||
toReplace = object;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toReplace != null)
|
|
||||||
{
|
|
||||||
inputList.remove(replaceIndex);
|
|
||||||
inputList.add(replaceIndex, OrbRegistry.getOrbsDownToTier((Integer) toReplace));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inputs = inputList;
|
this.inputs = inputList;
|
||||||
this.tier = tier;
|
this.tier = tier;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue