Update JEI compat

Supports new category item system.
Fixes Binding category input slot cycling through input and catalyst.
This commit is contained in:
Nicholas Ignoffo 2016-05-01 08:35:07 -07:00
parent 41edd86602
commit cfa40e9bfb
5 changed files with 19 additions and 13 deletions

View file

@ -57,7 +57,6 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
}
@Override
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
{
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
@ -67,7 +66,7 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI)
{
AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper;
recipeLayout.getItemStacks().set(INPUT_SLOT, alchemyArrayWrapper.getInputs().subList(0, alchemyArrayWrapper.getInputs().size() - 1));
recipeLayout.getItemStacks().set(INPUT_SLOT, alchemyArrayWrapper.getInputs());
recipeLayout.getItemStacks().set(CATALYST_SLOT, alchemyArrayWrapper.getCatalyst());
recipeLayout.getItemStacks().set(OUTPUT_SLOT, alchemyArrayWrapper.getOutputs());
}

View file

@ -1,6 +1,5 @@
package WayofTime.bloodmagic.compat.jei.alchemyArray;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@ -13,7 +12,7 @@ import net.minecraft.item.ItemStack;
public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
{
@Nonnull
private final Object inputs;
private final List<ItemStack> inputs;
@Nullable
private final ItemStack catalyst;
@ -21,7 +20,6 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
@Nonnull
private final ItemStack output;
@SuppressWarnings("unchecked")
public AlchemyArrayCraftingRecipeJEI(@Nonnull List<ItemStack> input, @Nullable ItemStack catalyst, @Nonnull ItemStack output)
{
this.inputs = input;
@ -30,9 +28,10 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
}
@Override
public List getInputs()
@Nonnull
public List<ItemStack> getInputs()
{
return Arrays.asList(inputs, catalyst);
return inputs;
}
public ItemStack getCatalyst()
@ -41,7 +40,8 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
}
@Override
public List getOutputs()
@Nonnull
public List<ItemStack> getOutputs()
{
return Collections.singletonList(output);
}