From 8ba9d8609bc3b9aeb69964ec01798d6106d68bd6 Mon Sep 17 00:00:00 2001 From: Nedelosk Date: Tue, 11 Apr 2017 17:50:41 +0200 Subject: [PATCH] Add MultiFenceRecipe Jei Registry Plugin --- .../binnie/extratrees/block/WoodManager.java | 21 ++- .../extratrees/block/decor/FenceType.java | 5 + .../block/decor/MultiFenceRecipePattern.java | 4 + .../extratrees/genetics/ETTreeDefinition.java | 2 + .../integration/jei/ExtraTreesJeiPlugin.java | 18 ++- .../MultiFenceRecipeEmbeddedWrapper.java | 92 +++++++++++++ .../MultiFenceRecipeRegistryPlugin.java | 123 ++++++++++++++++++ .../MultiFenceRecipeSizeWrapper.java | 108 +++++++++++++++ .../MultiFenceRecipeSolidWrapper.java | 92 +++++++++++++ 9 files changed, 463 insertions(+), 2 deletions(-) create mode 100644 src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeEmbeddedWrapper.java create mode 100644 src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeRegistryPlugin.java create mode 100644 src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSizeWrapper.java create mode 100644 src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSolidWrapper.java diff --git a/src/main/java/binnie/extratrees/block/WoodManager.java b/src/main/java/binnie/extratrees/block/WoodManager.java index 217ac6d2..40dccfe1 100644 --- a/src/main/java/binnie/extratrees/block/WoodManager.java +++ b/src/main/java/binnie/extratrees/block/WoodManager.java @@ -14,13 +14,16 @@ import forestry.core.utils.Translator; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; - import javax.annotation.Nullable; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class WoodManager { + public static Map PLANKS; public static String getDisplayName(IWoodTyped wood, IWoodType woodType) { WoodBlockKind blockKind = wood.getBlockKind(); @@ -134,6 +137,22 @@ public class WoodManager { Collections.addAll(list, PlankType.VanillaPlanks.values()); return list; } + + public static Map getAllPlankStacks(){ + if(PLANKS == null){ + PLANKS = new HashMap<>(); + for(IPlankType type : getAllPlankTypes()){ + PLANKS.put(type, type.getStack(false)); + } + } + return PLANKS; + } + + public static Collection getAllPlankStacks(IPlankType type){ + Map planks = new HashMap<>(getAllPlankStacks()); + planks.remove(type); + return planks.values(); + } @Nullable public static IPlankType getPlankType(ItemStack itemStack) { diff --git a/src/main/java/binnie/extratrees/block/decor/FenceType.java b/src/main/java/binnie/extratrees/block/decor/FenceType.java index 9d2cf8c6..47710080 100644 --- a/src/main/java/binnie/extratrees/block/decor/FenceType.java +++ b/src/main/java/binnie/extratrees/block/decor/FenceType.java @@ -71,6 +71,11 @@ public class FenceType { public boolean isPlain() { return this.size == 0 && !this.embossed && !this.solid; } + + @Override + public String toString() { + return size + (embossed ? ":embossed" : "") + (solid ? ":solid" : ""); + } @Override public boolean equals(final Object obj) { diff --git a/src/main/java/binnie/extratrees/block/decor/MultiFenceRecipePattern.java b/src/main/java/binnie/extratrees/block/decor/MultiFenceRecipePattern.java index 02ff49f7..e118d65d 100644 --- a/src/main/java/binnie/extratrees/block/decor/MultiFenceRecipePattern.java +++ b/src/main/java/binnie/extratrees/block/decor/MultiFenceRecipePattern.java @@ -28,6 +28,10 @@ public class MultiFenceRecipePattern{ this.pattern = pattern; } + public String getPattern() { + return pattern; + } + public int getTypeCount() { return typeCount; } diff --git a/src/main/java/binnie/extratrees/genetics/ETTreeDefinition.java b/src/main/java/binnie/extratrees/genetics/ETTreeDefinition.java index 7ac5c7c6..921f6389 100644 --- a/src/main/java/binnie/extratrees/genetics/ETTreeDefinition.java +++ b/src/main/java/binnie/extratrees/genetics/ETTreeDefinition.java @@ -310,6 +310,8 @@ public enum ETTreeDefinition implements IStringSerializable, ITreeDefinition, IT species.addFruitFamily(AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes")); species.addFruitFamily(AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes")); species.addFruitFamily(ETFruitFamily.Citrus); + species.setTemperature(EnumTemperature.NORMAL); + species.setRarity(0.0015F); } }, SourCherry("prunus", "cerasus", EnumLeafType.DECIDUOUS, new Color(0x6D8F1E), new Color(0xF7EBF6), EnumSaplingType.Fruit, EnumETLog.Cherry, new Color(0x716850)) { diff --git a/src/main/java/binnie/extratrees/integration/jei/ExtraTreesJeiPlugin.java b/src/main/java/binnie/extratrees/integration/jei/ExtraTreesJeiPlugin.java index 5ee54c3a..4657a7df 100644 --- a/src/main/java/binnie/extratrees/integration/jei/ExtraTreesJeiPlugin.java +++ b/src/main/java/binnie/extratrees/integration/jei/ExtraTreesJeiPlugin.java @@ -1,6 +1,10 @@ package binnie.extratrees.integration.jei; import binnie.core.integration.jei.Drawables; +import binnie.extratrees.ExtraTrees; +import binnie.extratrees.block.WoodManager; +import binnie.extratrees.block.decor.FenceDescription; +import binnie.extratrees.block.decor.FenceType; import binnie.extratrees.integration.jei.brewery.BreweryRecipeCategory; import binnie.extratrees.integration.jei.brewery.BreweryRecipeMaker; import binnie.extratrees.integration.jei.distillery.brewery.DistilleryRecipeCategory; @@ -9,6 +13,7 @@ import binnie.extratrees.integration.jei.fruitpress.FruitPressRecipeCategory; import binnie.extratrees.integration.jei.fruitpress.FruitPressRecipeMaker; import binnie.extratrees.integration.jei.lumbermill.LumbermillRecipeCategory; import binnie.extratrees.integration.jei.lumbermill.LumbermillRecipeMaker; +import binnie.extratrees.integration.jei.multifence.MultiFenceRecipeRegistryPlugin; import binnie.extratrees.machines.ExtraTreeMachine; import mezz.jei.api.BlankModPlugin; import mezz.jei.api.IGuiHelper; @@ -16,6 +21,8 @@ import mezz.jei.api.IJeiHelpers; import mezz.jei.api.IModRegistry; import mezz.jei.api.ISubtypeRegistry; import mezz.jei.api.JEIPlugin; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; @JEIPlugin public class ExtraTreesJeiPlugin extends BlankModPlugin { @@ -25,7 +32,14 @@ public class ExtraTreesJeiPlugin extends BlankModPlugin { @Override public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) { - + subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ExtraTrees.blocks().blockMultiFence), (ItemStack itemStack)->{ + FenceDescription desc = WoodManager.getFenceDescription(itemStack); + if(desc != null){ + FenceType type = WoodManager.getFenceType(itemStack); + return type + ":" + desc.getPlankType().getName().toLowerCase() + ":" + desc.getSecondaryPlankType().getName().toLowerCase(); + } + return Integer.toString(itemStack.getItemDamage()); + }); } @Override @@ -50,5 +64,7 @@ public class ExtraTreesJeiPlugin extends BlankModPlugin { registry.addRecipes(FruitPressRecipeMaker.create(), RecipeUids.FRUIT_PRESS); registry.addRecipes(BreweryRecipeMaker.create(), RecipeUids.BREWING); registry.addRecipes(DistilleryRecipeMaker.create(), RecipeUids.DISTILLING); + + registry.addRecipeRegistryPlugin(new MultiFenceRecipeRegistryPlugin()); } } diff --git a/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeEmbeddedWrapper.java b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeEmbeddedWrapper.java new file mode 100644 index 00000000..bd686b34 --- /dev/null +++ b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeEmbeddedWrapper.java @@ -0,0 +1,92 @@ +package binnie.extratrees.integration.jei.multifence; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; + +import javax.annotation.Nullable; + +import binnie.extratrees.block.IPlankType; +import binnie.extratrees.block.WoodManager; +import binnie.extratrees.block.decor.FenceDescription; +import binnie.extratrees.block.decor.FenceType; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.BlankRecipeWrapper; +import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper; +import net.minecraft.item.ItemStack; + +public class MultiFenceRecipeEmbeddedWrapper extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper { + + private FenceType fenceType; + @Nullable + private IPlankType plankType; + @Nullable + private IPlankType plankTypeSecondary; + + public MultiFenceRecipeEmbeddedWrapper(FenceType fenceType) { + this.fenceType = fenceType; + } + + public MultiFenceRecipeEmbeddedWrapper(IPlankType plankType, FenceType fenceType) { + this.plankType = plankType; + this.fenceType = fenceType; + } + + public MultiFenceRecipeEmbeddedWrapper(FenceDescription fenceDesc) { + this.plankType = fenceDesc.getPlankType(); + this.plankTypeSecondary = fenceDesc.getSecondaryPlankType(); + this.fenceType = fenceDesc.getFenceType(); + } + + @Override + public void getIngredients(IIngredients ingredients) { + List fences = new ArrayList<>(); + List planks = new ArrayList<>(); + List outputFences = new ArrayList<>(); + if(plankType != null){ + if(plankTypeSecondary == null){ + for(Entry secondary : WoodManager.getAllPlankStacks().entrySet()){ + IPlankType plankTypeSecondary = secondary.getKey(); + if(plankType != plankTypeSecondary){ + planks.add(plankType.getStack(false)); + fences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, fenceType.solid, false), 1)); + outputFences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, fenceType.solid, true), 2)); + } + } + }else{ + planks.add(plankType.getStack(false)); + fences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, fenceType.solid, false), 1)); + outputFences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, fenceType.solid, true), 2)); + } + }else{ + for(IPlankType plankTypeSecondary : WoodManager.getAllPlankTypes()){ + for(IPlankType plankType : WoodManager.getAllPlankTypes()){ + if(plankType != plankTypeSecondary){ + planks.add(plankType.getStack(false)); + fences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, fenceType.solid, false), 1)); + outputFences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, fenceType.solid, true), 2)); + } + } + } + } + List> itemInputs = new ArrayList<>(); + itemInputs.add(fences); + itemInputs.add(planks); + itemInputs.add(fences); + List> itemOutputs = new ArrayList<>(); + itemOutputs.add(outputFences); + ingredients.setOutputLists(ItemStack.class, itemOutputs); + ingredients.setInputLists(ItemStack.class, itemInputs); + } + + @Override + public int getWidth() { + return 3; + } + + @Override + public int getHeight() { + return 1; + } + +} diff --git a/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeRegistryPlugin.java b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeRegistryPlugin.java new file mode 100644 index 00000000..d86b4846 --- /dev/null +++ b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeRegistryPlugin.java @@ -0,0 +1,123 @@ +package binnie.extratrees.integration.jei.multifence; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import binnie.extratrees.block.IPlankType; +import binnie.extratrees.block.WoodManager; +import binnie.extratrees.block.decor.FenceDescription; +import binnie.extratrees.block.decor.FenceType; +import binnie.extratrees.block.decor.MultiFenceRecipePattern; +import mezz.jei.api.recipe.IFocus; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeRegistryPlugin; +import mezz.jei.api.recipe.IRecipeWrapper; +import mezz.jei.api.recipe.VanillaRecipeCategoryUid; +import mezz.jei.api.recipe.IFocus.Mode; +import mezz.jei.gui.Focus; +import net.minecraft.item.ItemStack; + +public class MultiFenceRecipeRegistryPlugin implements IRecipeRegistryPlugin { + + public List recipes = new ArrayList<>(); + + @Override + public List getRecipeCategoryUids(IFocus focus) { + focus = Focus.check(focus); + V ingredient = focus.getValue(); + + if(!(ingredient instanceof ItemStack)){ + return Collections.emptyList(); + } + ItemStack itemStack = (ItemStack) ingredient; + FenceDescription desc; + switch (focus.getMode()) { + case INPUT: + desc = WoodManager.getFenceDescription(itemStack); + IPlankType plankType = WoodManager.getPlankType(itemStack); + if(plankType != null || desc != null && (!desc.getFenceType().embossed || !desc.getFenceType().embossed)){ + return Collections.singletonList(VanillaRecipeCategoryUid.CRAFTING); + } + return Collections.emptyList(); + case OUTPUT: + desc = WoodManager.getFenceDescription(itemStack); + if(desc != null){ + return Collections.singletonList(VanillaRecipeCategoryUid.CRAFTING); + } + return Collections.emptyList(); + default: + return Collections.singletonList(VanillaRecipeCategoryUid.CRAFTING); + } + } + + @Override + public List getRecipeWrappers(IRecipeCategory recipeCategory, IFocus focus) { + focus = Focus.check(focus); + V ingredient = focus.getValue(); + if(!recipeCategory.getUid().equals(VanillaRecipeCategoryUid.CRAFTING) || !(ingredient instanceof ItemStack)){ + return Collections.emptyList(); + } + return (List) getRecipes((IFocus) focus); + } + + @Override + public List getRecipeWrappers(IRecipeCategory recipeCategory) { + if(!recipeCategory.getUid().equals(VanillaRecipeCategoryUid.CRAFTING)){ + return Collections.emptyList(); + } + if(recipes.isEmpty()){ + for(MultiFenceRecipePattern pattern : MultiFenceRecipePattern.VALUES){ + recipes.add(new MultiFenceRecipeSizeWrapper(pattern)); + } + for(FenceType fenceType : FenceType.VALUES){ + recipes.add(new MultiFenceRecipeEmbeddedWrapper(fenceType)); + recipes.add(new MultiFenceRecipeSolidWrapper(fenceType)); + } + } + return (List) recipes; + } + + private List getRecipes(IFocus focus){ + ItemStack ingredient = focus.getValue(); + List recipes = new ArrayList<>(); + if(focus.getMode() == Mode.INPUT){ + IPlankType plankType = WoodManager.getPlankType(ingredient); + if(plankType != null){ + for(MultiFenceRecipePattern pattern : MultiFenceRecipePattern.VALUES){ + recipes.add(new MultiFenceRecipeSizeWrapper(pattern, plankType)); + } + for(int size = 0;size < 3;size++){ + for (final boolean solid : new boolean[]{false, true}) { + recipes.add(new MultiFenceRecipeEmbeddedWrapper(plankType, new FenceType(size, solid, false))); + } + } + }else{ + FenceDescription desc = WoodManager.getFenceDescription(ingredient); + if(desc != null){ + if(!desc.getFenceType().embossed){ + recipes.add(new MultiFenceRecipeEmbeddedWrapper(desc)); + } + if(!desc.getFenceType().solid){ + recipes.add(new MultiFenceRecipeSolidWrapper(desc)); + } + } + } + }else{ + FenceDescription desc = WoodManager.getFenceDescription(ingredient); + if(desc != null){ + int size = desc.getFenceType().size; + recipes.add(new MultiFenceRecipeSizeWrapper(MultiFenceRecipePattern.VALUES[size * 2], desc.getPlankType(), desc.getSecondaryPlankType())); + recipes.add(new MultiFenceRecipeSizeWrapper(MultiFenceRecipePattern.VALUES[size * 2 + 1], desc.getPlankType(), desc.getSecondaryPlankType())); + if(desc.getFenceType().embossed){ + recipes.add(new MultiFenceRecipeEmbeddedWrapper(desc)); + } + if(desc.getFenceType().solid){ + recipes.add(new MultiFenceRecipeSolidWrapper(desc)); + } + } + } + return recipes; + } + +} diff --git a/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSizeWrapper.java b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSizeWrapper.java new file mode 100644 index 00000000..c091f01d --- /dev/null +++ b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSizeWrapper.java @@ -0,0 +1,108 @@ +package binnie.extratrees.integration.jei.multifence; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nullable; + +import binnie.extratrees.block.IPlankType; +import binnie.extratrees.block.WoodManager; +import binnie.extratrees.block.decor.MultiFenceRecipePattern; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.BlankRecipeWrapper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; + +public class MultiFenceRecipeSizeWrapper extends BlankRecipeWrapper { + + @Nullable + private IPlankType plankType; + @Nullable + private IPlankType plankTypeSecond; + private MultiFenceRecipePattern pattern; + private String[] recipePattern; + + + public MultiFenceRecipeSizeWrapper(MultiFenceRecipePattern pattern) { + this(pattern, null, null); + } + + public MultiFenceRecipeSizeWrapper(MultiFenceRecipePattern pattern, @Nullable IPlankType plankType) { + this(pattern, plankType, null); + } + + public MultiFenceRecipeSizeWrapper(MultiFenceRecipePattern pattern, @Nullable IPlankType plankType, @Nullable IPlankType plankTypeSecond) { + this.pattern = pattern; + String recipePattern = pattern.getPattern(); + this.recipePattern = new String[3]; + this.recipePattern[0] = recipePattern.substring(0, 3); + this.recipePattern[1] = recipePattern.substring(3, 6); + this.recipePattern[2] = recipePattern.substring(6); + this.plankType = plankType; + this.plankTypeSecond = plankTypeSecond; + } + + @Override + public void getIngredients(IIngredients ingredients) { + int typeCount = pattern.getTypeCount(); + List> types = NonNullList.create(); + if(this.plankType != null){ + types.add(Collections.singletonList(plankType.getStack(false))); + }else{ + List planks = new ArrayList<>(WoodManager.getAllPlankStacks().values()); + Collections.shuffle(planks); + types.add(planks); + } + if(typeCount > 1){ + if(plankTypeSecond != null){ + types.add(Collections.singletonList(plankTypeSecond.getStack(false))); + }else{ + List planks; + if(plankType != null){ + planks = new ArrayList<>(WoodManager.getAllPlankStacks(plankType)); + }else{ + planks = new ArrayList<>(WoodManager.getAllPlankStacks().values()); + } + Collections.shuffle(planks); + types.add(planks); + } + }else{ + types.add(types.get(0)); + } + List> itemInputs = NonNullList.withSize(9, NonNullList.create()); + for(int p = 0;p < 3;p++){ + String recipePattern = this.recipePattern[p]; + for(int index = 0;index < 3;index++){ + char c = recipePattern.charAt(index); + if(c == '0'){ + itemInputs.set(p * 3 + index, types.get(0)); + }else if(c == '1'){ + itemInputs.set(p * 3 + index, types.get(1)); + }else{ + itemInputs.set(p * 3 + index, NonNullList.withSize(1, ItemStack.EMPTY)); + } + } + } + List> itemOutputs = new ArrayList<>(); + int size = typeCount > 1 || plankType == null ? types.get(1).size() : 1; + List outputs = new ArrayList<>(); + itemOutputs.add(outputs); + for(int i = 0;i < size;i++){ + ItemStack item = types.get(0).get(i); + ItemStack itemSecond = types.get(1).get(i); + IPlankType plankType = this.plankType; + if(plankType == null){ + plankType = WoodManager.getPlankType(item); + } + IPlankType plankTypeSecond = this.plankTypeSecond; + if(plankTypeSecond == null){ + plankTypeSecond = WoodManager.getPlankType(itemSecond); + } + outputs.add(pattern.createFence(plankType, plankTypeSecond)); + } + ingredients.setOutputLists(ItemStack.class, itemOutputs); + ingredients.setInputLists(ItemStack.class, itemInputs); + } + +} diff --git a/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSolidWrapper.java b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSolidWrapper.java new file mode 100644 index 00000000..5361c715 --- /dev/null +++ b/src/main/java/binnie/extratrees/integration/jei/multifence/MultiFenceRecipeSolidWrapper.java @@ -0,0 +1,92 @@ +package binnie.extratrees.integration.jei.multifence; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nullable; + +import binnie.extratrees.block.IPlankType; +import binnie.extratrees.block.WoodManager; +import binnie.extratrees.block.decor.FenceDescription; +import binnie.extratrees.block.decor.FenceType; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.BlankRecipeWrapper; +import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper; +import net.minecraft.item.ItemStack; + +public class MultiFenceRecipeSolidWrapper extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper { + + private FenceType fenceType; + @Nullable + private IPlankType plankType; + @Nullable + private IPlankType plankTypeSecondary; + + public MultiFenceRecipeSolidWrapper(FenceType fenceType) { + this.fenceType = fenceType; + this.plankType = null; + this.plankTypeSecondary = null; + } + + public MultiFenceRecipeSolidWrapper(FenceDescription fenceDesc) { + this.fenceType = fenceDesc.getFenceType(); + this.plankType = fenceDesc.getPlankType(); + this.plankTypeSecondary = fenceDesc.getSecondaryPlankType(); + } + + @Override + public void getIngredients(IIngredients ingredients) { + List fences = new ArrayList<>(); + List outputFences = new ArrayList<>(); + if(plankType != null){ + if(plankTypeSecondary == null){ + for(IPlankType plankTypeSecondary : WoodManager.getAllPlankTypes()){ + if(plankType != plankTypeSecondary){ + fences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, false, fenceType.embossed), 1)); + outputFences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, true, fenceType.embossed), 2)); + } + } + }else{ + fences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, false, fenceType.embossed), 1)); + outputFences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, true, fenceType.embossed), 2)); + } + }else{ + for(IPlankType plankTypeSecondary : WoodManager.getAllPlankTypes()){ + for(IPlankType plankType : WoodManager.getAllPlankTypes()){ + if(plankType != plankTypeSecondary){; + fences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, false, fenceType.embossed), 1)); + outputFences.add(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, true, fenceType.embossed), 2)); + } + } + } + } + List> itemInputs = new ArrayList<>(); + itemInputs.add(fences); + itemInputs.add(fences); + itemInputs.add(fences); + List> itemOutputs = new ArrayList<>(); + itemOutputs.add(outputFences); + ingredients.setOutputLists(ItemStack.class, itemOutputs); + ingredients.setInputLists(ItemStack.class, itemInputs); + /*List fences = Collections.singletonList(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, false, fenceType.embossed), 1)); + List outputFences = Collections.singletonList(WoodManager.getFence(plankType, plankTypeSecondary, new FenceType(fenceType.size, true, fenceType.embossed), 2)); + List> itemInputs = new ArrayList<>(); + itemInputs.add(fences); + itemInputs.add(fences); + itemInputs.add(fences); + List> itemOutputs = new ArrayList<>(); + itemOutputs.add(outputFences); + ingredients.setOutputLists(ItemStack.class, itemOutputs); + ingredients.setInputLists(ItemStack.class, itemInputs);*/ + } + + @Override + public int getWidth() { + return 3; + } + + @Override + public int getHeight() { + return 1; + } + +}