From 57f16ec321cdd57975287c765cc2429b0bf3e340 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 8 Nov 2016 23:35:11 +0100 Subject: [PATCH] Update JEI --- build.gradle | 2 +- .../mod/jei/RecipeWrapperWithButton.java | 4 +- .../jei/booklet/BookletRecipeCategory.java | 31 ++---------- .../mod/jei/booklet/BookletRecipeHandler.java | 1 - .../mod/jei/booklet/BookletRecipeWrapper.java | 25 ++-------- .../coffee/CoffeeMachineRecipeCategory.java | 43 +++++----------- .../coffee/CoffeeMachineRecipeWrapper.java | 24 +-------- .../jei/crusher/CrusherRecipeCategory.java | 43 ++++------------ .../mod/jei/crusher/CrusherRecipeWrapper.java | 22 +-------- .../empowerer/EmpowererRecipeCategory.java | 49 ++++++------------- .../jei/empowerer/EmpowererRecipeWrapper.java | 23 +-------- .../ReconstructorRecipeCategory.java | 32 +++--------- .../ReconstructorRecipeWrapper.java | 23 +-------- 13 files changed, 64 insertions(+), 258 deletions(-) diff --git a/build.gradle b/build.gradle index c277ef00f..77f72b126 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ repositories { dependencies { compile "net.darkhax.tesla:Tesla:1.10.2-1.2.1.49" - deobfCompile "mezz.jei:jei_1.10.2:3.13.0.335" + deobfCompile "mezz.jei:jei_1.10.2:3.13.2.360" } processResources { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java index 0be55cc03..dad6dcf89 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java @@ -17,14 +17,14 @@ import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; import de.ellpeck.actuallyadditions.mod.booklet.button.TexturedButton; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import mezz.jei.api.recipe.IRecipeWrapper; +import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.client.Minecraft; import javax.annotation.Nullable; import java.util.Collections; import java.util.List; -public abstract class RecipeWrapperWithButton implements IRecipeWrapper{ +public abstract class RecipeWrapperWithButton extends BlankRecipeWrapper{ protected final TexturedButton theButton; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java index ff9b7a3df..0f8f1ea43 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java @@ -15,13 +15,11 @@ import mezz.jei.api.IGuiHelper; 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.api.recipe.IRecipeWrapper; -import net.minecraft.client.Minecraft; +import mezz.jei.api.recipe.BlankRecipeCategory; import java.util.Arrays; -public class BookletRecipeCategory implements IRecipeCategory{ +public class BookletRecipeCategory extends BlankRecipeCategory{ public static final String NAME = "actuallyadditions.booklet"; @@ -31,7 +29,6 @@ public class BookletRecipeCategory implements IRecipeCategory{ this.background = helper.createBlankDrawable(160, 105); } - @Override public String getUid(){ return NAME; @@ -50,26 +47,8 @@ public class BookletRecipeCategory implements IRecipeCategory{ } @Override - public void drawExtras(Minecraft minecraft){ - - } - - @Override - public void drawAnimations(Minecraft minecraft){ - - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ - - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients){ - if(recipeWrapper instanceof BookletRecipeWrapper){ - BookletRecipeWrapper wrapper = (BookletRecipeWrapper)recipeWrapper; - recipeLayout.getItemStacks().init(0, true, 70, -4); - recipeLayout.getItemStacks().set(0, Arrays.asList(wrapper.thePage.getItemStacksForPage())); - } + public void setRecipe(IRecipeLayout recipeLayout, BookletRecipeWrapper wrapper, IIngredients ingredients){ + recipeLayout.getItemStacks().init(0, true, 70, -4); + recipeLayout.getItemStacks().set(0, Arrays.asList(wrapper.thePage.getItemStacksForPage())); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java index eedd70b6a..ebb7b650e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java @@ -32,7 +32,6 @@ public class BookletRecipeHandler implements IRecipeHandler{ return BookletRecipeCategory.NAME; } - @Override public IRecipeWrapper getRecipeWrapper(BookletPage recipe){ return new BookletRecipeWrapper(recipe); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java index 8b3c332fa..469b95f71 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java @@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.ingredients.IIngredients; import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fluids.FluidStack; @@ -34,27 +35,11 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton{ @Override public void getIngredients(IIngredients ingredients){ + ingredients.setInputs(ItemStack.class, Arrays.asList(this.thePage.getItemStacksForPage())); + ingredients.setInputs(FluidStack.class, Arrays.asList(this.thePage.getFluidStacksForPage())); - } - - @Override - public List getInputs(){ - return Arrays.asList(this.thePage.getItemStacksForPage()); - } - - @Override - public List getOutputs(){ - return Arrays.asList(this.thePage.getItemStacksForPage()); - } - - @Override - public List getFluidInputs(){ - return Arrays.asList(this.thePage.getFluidStacksForPage()); - } - - @Override - public List getFluidOutputs(){ - return Arrays.asList(this.thePage.getFluidStacksForPage()); + ingredients.setOutputs(ItemStack.class, Arrays.asList(this.thePage.getItemStacksForPage())); + ingredients.setOutputs(FluidStack.class, Arrays.asList(this.thePage.getFluidStacksForPage())); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java index a29337377..1d01f02db 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java @@ -16,11 +16,11 @@ import mezz.jei.api.IGuiHelper; 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.api.recipe.BlankRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; -public class CoffeeMachineRecipeCategory implements IRecipeCategory{ +public class CoffeeMachineRecipeCategory extends BlankRecipeCategory{ public static final String NAME = "actuallyadditions.coffee"; @@ -30,54 +30,33 @@ public class CoffeeMachineRecipeCategory implements IRecipeCategory{ this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiNEICoffeeMachine"), 0, 0, 126, 92); } - @Override public String getUid(){ return NAME; } - @Override public String getTitle(){ return StringUtil.localize("container.nei."+NAME+".name"); } - @Override public IDrawable getBackground(){ return this.background; } @Override - public void drawExtras(Minecraft minecraft){ + public void setRecipe(IRecipeLayout recipeLayout, CoffeeMachineRecipeWrapper wrapper, IIngredients ingredients){ + recipeLayout.getItemStacks().init(0, true, 89, 20); + recipeLayout.getItemStacks().set(0, wrapper.theIngredient.ingredient); - } + recipeLayout.getItemStacks().init(1, true, 44, 38); + recipeLayout.getItemStacks().set(1, wrapper.cup); - @Override - public void drawAnimations(Minecraft minecraft){ + recipeLayout.getItemStacks().init(2, true, 1, 38); + recipeLayout.getItemStacks().set(2, wrapper.coffeeBeans); - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients){ - if(recipeWrapper instanceof CoffeeMachineRecipeWrapper){ - CoffeeMachineRecipeWrapper wrapper = (CoffeeMachineRecipeWrapper)recipeWrapper; - - recipeLayout.getItemStacks().init(0, true, 89, 20); - recipeLayout.getItemStacks().set(0, wrapper.theIngredient.ingredient); - - recipeLayout.getItemStacks().init(1, true, 44, 38); - recipeLayout.getItemStacks().set(1, wrapper.cup); - - recipeLayout.getItemStacks().init(2, true, 1, 38); - recipeLayout.getItemStacks().set(2, wrapper.coffeeBeans); - - recipeLayout.getItemStacks().init(3, false, 44, 69); - recipeLayout.getItemStacks().set(3, wrapper.theOutput); - } + recipeLayout.getItemStacks().init(3, false, 44, 69); + recipeLayout.getItemStacks().set(3, wrapper.theOutput); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index 27402e93c..f5401654a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -23,10 +23,8 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.ingredients.IIngredients; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import java.util.Collections; import java.util.List; public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton{ @@ -45,31 +43,13 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton{ @Override public void getIngredients(IIngredients ingredients){ - - } - - @Override - public List getInputs(){ List list = new ArrayList(); list.add(this.theIngredient.ingredient); list.add(this.cup); list.add(this.coffeeBeans); - return list; - } + ingredients.setInputs(ItemStack.class, list); - @Override - public List getOutputs(){ - return Collections.singletonList(this.theOutput); - } - - @Override - public List getFluidInputs(){ - return new ArrayList(); - } - - @Override - public List getFluidOutputs(){ - return new ArrayList(); + ingredients.setOutput(ItemStack.class, this.theOutput); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java index f3f618862..54dd3d69c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java @@ -16,11 +16,9 @@ import mezz.jei.api.IGuiHelper; 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.api.recipe.IRecipeWrapper; -import net.minecraft.client.Minecraft; +import mezz.jei.api.recipe.BlankRecipeCategory; -public class CrusherRecipeCategory implements IRecipeCategory{ +public class CrusherRecipeCategory extends BlankRecipeCategory{ public static final String NAME = "actuallyadditions.crushing"; @@ -30,53 +28,32 @@ public class CrusherRecipeCategory implements IRecipeCategory{ this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiGrinder"), 60, 13, 56, 79); } - @Override public String getUid(){ return NAME; } - @Override public String getTitle(){ return StringUtil.localize("container.nei."+NAME+".name"); } - @Override public IDrawable getBackground(){ return this.background; } @Override - public void drawExtras(Minecraft minecraft){ + public void setRecipe(IRecipeLayout recipeLayout, CrusherRecipeWrapper wrapper, IIngredients ingredients){ + recipeLayout.getItemStacks().init(0, true, 19, 7); + recipeLayout.getItemStacks().set(0, wrapper.theRecipe.inputStack); - } + recipeLayout.getItemStacks().init(1, false, 7, 55); + recipeLayout.getItemStacks().set(1, wrapper.theRecipe.outputOneStack); - @Override - public void drawAnimations(Minecraft minecraft){ - - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients){ - if(recipeWrapper instanceof CrusherRecipeWrapper){ - CrusherRecipeWrapper wrapper = (CrusherRecipeWrapper)recipeWrapper; - - recipeLayout.getItemStacks().init(0, true, 19, 7); - recipeLayout.getItemStacks().set(0, wrapper.theRecipe.inputStack); - - recipeLayout.getItemStacks().init(1, false, 7, 55); - recipeLayout.getItemStacks().set(1, wrapper.theRecipe.outputOneStack); - - if(wrapper.theRecipe.outputTwoStack != null){ - recipeLayout.getItemStacks().init(2, false, 31, 55); - recipeLayout.getItemStacks().set(2, wrapper.theRecipe.outputTwoStack); - } + if(wrapper.theRecipe.outputTwoStack != null){ + recipeLayout.getItemStacks().init(2, false, 31, 55); + recipeLayout.getItemStacks().set(2, wrapper.theRecipe.outputTwoStack); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java index aafeef01b..33fb9c309 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -35,32 +35,14 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton{ @Override public void getIngredients(IIngredients ingredients){ + ingredients.setInput(ItemStack.class, this.theRecipe.inputStack); - } - - @Override - public List getInputs(){ - return Collections.singletonList(this.theRecipe.inputStack); - } - - @Override - public List getOutputs(){ List list = new ArrayList(); list.add(this.theRecipe.outputOneStack); if(this.theRecipe.outputTwoStack != null){ list.add(this.theRecipe.outputTwoStack); } - return list; - } - - @Override - public List getFluidInputs(){ - return new ArrayList(); - } - - @Override - public List getFluidOutputs(){ - return new ArrayList(); + ingredients.setOutputs(ItemStack.class, list); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeCategory.java index ebfc62bc0..041e0550a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeCategory.java @@ -16,11 +16,11 @@ import mezz.jei.api.IGuiHelper; 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.api.recipe.BlankRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; -public class EmpowererRecipeCategory implements IRecipeCategory{ +public class EmpowererRecipeCategory extends BlankRecipeCategory{ public static final String NAME = "actuallyadditions.empowerer"; @@ -40,48 +40,29 @@ public class EmpowererRecipeCategory implements IRecipeCategory{ return StringUtil.localize("container.nei."+NAME+".name"); } - @Override public IDrawable getBackground(){ return this.background; } @Override - public void drawExtras(Minecraft minecraft){ + public void setRecipe(IRecipeLayout recipeLayout, EmpowererRecipeWrapper wrapper, IIngredients ingredients){ + recipeLayout.getItemStacks().init(0, true, 31, 31); + recipeLayout.getItemStacks().set(0, wrapper.theRecipe.input); - } + recipeLayout.getItemStacks().init(1, true, 1, 31); + recipeLayout.getItemStacks().set(1, wrapper.theRecipe.modifier1); - @Override - public void drawAnimations(Minecraft minecraft){ + recipeLayout.getItemStacks().init(2, true, 31, 1); + recipeLayout.getItemStacks().set(2, wrapper.theRecipe.modifier2); - } + recipeLayout.getItemStacks().init(3, true, 61, 31); + recipeLayout.getItemStacks().set(3, wrapper.theRecipe.modifier3); - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ - } + recipeLayout.getItemStacks().init(4, true, 31, 61); + recipeLayout.getItemStacks().set(4, wrapper.theRecipe.modifier4); - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients){ - if(recipeWrapper instanceof EmpowererRecipeWrapper){ - EmpowererRecipeWrapper wrapper = (EmpowererRecipeWrapper)recipeWrapper; - - recipeLayout.getItemStacks().init(0, true, 31, 31); - recipeLayout.getItemStacks().set(0, wrapper.theRecipe.input); - - recipeLayout.getItemStacks().init(1, true, 1, 31); - recipeLayout.getItemStacks().set(1, wrapper.theRecipe.modifier1); - - recipeLayout.getItemStacks().init(2, true, 31, 1); - recipeLayout.getItemStacks().set(2, wrapper.theRecipe.modifier2); - - recipeLayout.getItemStacks().init(3, true, 61, 31); - recipeLayout.getItemStacks().set(3, wrapper.theRecipe.modifier3); - - recipeLayout.getItemStacks().init(4, true, 31, 61); - recipeLayout.getItemStacks().set(4, wrapper.theRecipe.modifier4); - - recipeLayout.getItemStacks().init(5, false, 112, 31); - recipeLayout.getItemStacks().set(5, wrapper.theRecipe.output); - } + recipeLayout.getItemStacks().init(5, false, 112, 31); + recipeLayout.getItemStacks().set(5, wrapper.theRecipe.output); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java index b89ecf4da..903fe5572 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java @@ -35,27 +35,8 @@ public class EmpowererRecipeWrapper extends RecipeWrapperWithButton{ @Override public void getIngredients(IIngredients ingredients){ - - } - - @Override - public List getInputs(){ - return Arrays.asList(this.theRecipe.input, this.theRecipe.modifier1, this.theRecipe.modifier2, this.theRecipe.modifier3, this.theRecipe.modifier4); - } - - @Override - public List getOutputs(){ - return Collections.singletonList(this.theRecipe.output); - } - - @Override - public List getFluidInputs(){ - return new ArrayList(); - } - - @Override - public List getFluidOutputs(){ - return new ArrayList(); + ingredients.setInputs(ItemStack.class, Arrays.asList(this.theRecipe.input, this.theRecipe.modifier1, this.theRecipe.modifier2, this.theRecipe.modifier3, this.theRecipe.modifier4)); + ingredients.setOutput(ItemStack.class, this.theRecipe.output); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java index 029151d76..2ec916808 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java @@ -17,12 +17,11 @@ import mezz.jei.api.IGuiHelper; 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.api.recipe.IRecipeWrapper; +import mezz.jei.api.recipe.BlankRecipeCategory; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -public class ReconstructorRecipeCategory implements IRecipeCategory{ +public class ReconstructorRecipeCategory extends BlankRecipeCategory{ public static final String NAME = "actuallyadditions.reconstructor"; @@ -33,19 +32,16 @@ public class ReconstructorRecipeCategory implements IRecipeCategory{ this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiNEIAtomicReconstructor"), 0, 0, 96, 60); } - @Override public String getUid(){ return NAME; } - @Override public String getTitle(){ return StringUtil.localize("container.nei."+NAME+".name"); } - @Override public IDrawable getBackground(){ return this.background; @@ -57,25 +53,11 @@ public class ReconstructorRecipeCategory implements IRecipeCategory{ } @Override - public void drawAnimations(Minecraft minecraft){ + public void setRecipe(IRecipeLayout recipeLayout, ReconstructorRecipeWrapper wrapper, IIngredients ingredients){ + recipeLayout.getItemStacks().init(0, true, 4, 18); + recipeLayout.getItemStacks().set(0, wrapper.theRecipe.inputStack); - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ - } - - @Override - public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients){ - if(recipeWrapper instanceof ReconstructorRecipeWrapper){ - ReconstructorRecipeWrapper wrapper = (ReconstructorRecipeWrapper)recipeWrapper; - - recipeLayout.getItemStacks().init(0, true, 4, 18); - recipeLayout.getItemStacks().set(0, wrapper.theRecipe.inputStack); - - recipeLayout.getItemStacks().init(1, false, 66, 18); - recipeLayout.getItemStacks().set(1, wrapper.theRecipe.outputStack); - - } + recipeLayout.getItemStacks().init(1, false, 66, 18); + recipeLayout.getItemStacks().set(1, wrapper.theRecipe.outputStack); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java index c89360dcc..31a9e563a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -34,27 +34,8 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton{ @Override public void getIngredients(IIngredients ingredients){ - - } - - @Override - public List getInputs(){ - return Collections.singletonList(this.theRecipe.inputStack); - } - - @Override - public List getOutputs(){ - return Collections.singletonList(this.theRecipe.outputStack); - } - - @Override - public List getFluidInputs(){ - return new ArrayList(); - } - - @Override - public List getFluidOutputs(){ - return new ArrayList(); + ingredients.setInput(ItemStack.class, this.theRecipe.inputStack); + ingredients.setOutput(ItemStack.class, this.theRecipe.outputStack); } @Override