From d88748aa93405048dd0f92440169f96815e7a54d Mon Sep 17 00:00:00 2001 From: Dragon2488 Date: Sat, 1 Oct 2016 11:20:56 +0700 Subject: [PATCH] Legacy & New JEI capability --- .../java/gregtech/jei/JEIGregtechRecipe.java | 18 +++++++++++++----- .../gregtech/jei/JEIGregtehRecipeCategory.java | 6 ++++++ src/main/java/gregtech/jei/JEI_GT_Plugin.java | 7 +++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/jei/JEIGregtechRecipe.java b/src/main/java/gregtech/jei/JEIGregtechRecipe.java index e8d6aba8..d096d046 100644 --- a/src/main/java/gregtech/jei/JEIGregtechRecipe.java +++ b/src/main/java/gregtech/jei/JEIGregtechRecipe.java @@ -7,6 +7,7 @@ import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IGuiFluidStackGroup; import mezz.jei.api.gui.IGuiItemStackGroup; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -15,9 +16,7 @@ import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; +import java.util.*; public class JEIGregtechRecipe implements IRecipeWrapper { @@ -606,12 +605,21 @@ public class JEIGregtechRecipe implements IRecipeWrapper { } @Override - public List getInputs() { + public void getIngredients(IIngredients ingredients) { + ingredients.setInputs(ItemStack.class, getInputs()); + ingredients.setInputs(FluidStack.class, getFluidInputs()); + + ingredients.setOutputs(ItemStack.class, getOutputs()); + ingredients.setOutputs(FluidStack.class, getFluidOutputs()); + } + + @Override + public List getInputs() { return Arrays.asList(mRecipe.mInputs); } @Override - public List getOutputs() { + public List getOutputs() { return Arrays.asList(mRecipe.mOutputs); } diff --git a/src/main/java/gregtech/jei/JEIGregtehRecipeCategory.java b/src/main/java/gregtech/jei/JEIGregtehRecipeCategory.java index 5abdd95f..40fdd8e8 100644 --- a/src/main/java/gregtech/jei/JEIGregtehRecipeCategory.java +++ b/src/main/java/gregtech/jei/JEIGregtehRecipeCategory.java @@ -5,6 +5,7 @@ import gregtech.api.util.GT_Recipe; import mezz.jei.Internal; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.gui.DrawableResource; import net.minecraft.client.Minecraft; @@ -62,4 +63,9 @@ public class JEIGregtehRecipeCategory implements IRecipeCategory