From 468a626aa4498f79f0cc6575e89fbff02e0a202b Mon Sep 17 00:00:00 2001 From: laod Date: Sat, 4 Feb 2017 13:15:33 -0600 Subject: [PATCH 1/3] Forestry JEI recipe hack example. --- .../java/modtweaker/mods/forestry/ForestryListAddition.java | 3 +-- src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java b/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java index 16e769b..c6a19e6 100644 --- a/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java +++ b/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java @@ -15,7 +15,7 @@ public abstract class ForestryListAddition extends Ba super(name, new ArrayList(manager.recipes())); this.manager = manager; } - + @Override protected abstract String getRecipeInfo(T recipe); @@ -25,7 +25,6 @@ public abstract class ForestryListAddition extends Ba if (recipe != null) { if (manager.addRecipe(recipe)){ successful.add(recipe); - MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(recipe); } else { LogHelper.logError(String.format("Error adding %s Recipe for %s", name, getRecipeInfo(recipe))); } diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java b/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java index 7a9cbff..c15eabe 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java @@ -2,6 +2,7 @@ package modtweaker.mods.forestry.handlers; import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; +import forestry.factory.recipes.jei.squeezer.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import minetweaker.api.liquid.ILiquidStack; @@ -46,6 +47,7 @@ public class Squeezer { public Add(ISqueezerRecipe recipe) { super(Squeezer.name, RecipeManagers.squeezerManager); recipes.add(recipe); + MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new SqueezerRecipeWrapper(recipe)); } @Override From 88911ecf77faf40f415ccb351a865bb7d089fbf0 Mon Sep 17 00:00:00 2001 From: laod Date: Sat, 4 Feb 2017 15:27:15 -0600 Subject: [PATCH 2/3] JEI Hack for all but the moistener. --- .../java/modtweaker/mods/forestry/handlers/Carpenter.java | 5 +++++ .../java/modtweaker/mods/forestry/handlers/Centrifuge.java | 5 +++++ .../java/modtweaker/mods/forestry/handlers/Fermenter.java | 5 +++++ .../java/modtweaker/mods/forestry/handlers/Squeezer.java | 3 +++ src/main/java/modtweaker/mods/forestry/handlers/Still.java | 5 +++++ .../mods/forestry/handlers/ThermionicFabricator.java | 5 +++++ 6 files changed, 28 insertions(+) diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java b/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java index e073c14..a35a449 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java @@ -4,6 +4,7 @@ import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; import forestry.core.recipes.ShapedRecipeCustom; import forestry.factory.recipes.CarpenterRecipeManager; +import forestry.factory.recipes.jei.carpenter.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import minetweaker.api.liquid.ILiquidStack; @@ -56,6 +57,7 @@ public class Carpenter { public Add(ICarpenterRecipe recipe) { super(Carpenter.name, RecipeManagers.carpenterManager); recipes.add(recipe); + MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new CarpenterRecipeWrapper(recipe)); } // @Override @@ -134,6 +136,9 @@ public class Carpenter { public Remove(List recipes) { super(Carpenter.name, RecipeManagers.carpenterManager, recipes); +// for(ICarpenterRecipe recipe: recipes){ +// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new CarpenterRecipeWrapper(recipe)); +// } } @Override diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java b/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java index fe60471..db54587 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java @@ -13,6 +13,7 @@ import java.util.*; import static com.blamejared.mtlib.helpers.InputHelper.*; import static com.blamejared.mtlib.helpers.StackHelper.matches; +import forestry.factory.recipes.jei.centrifuge.*; @ZenClass("mods.forestry.Centrifuge") @@ -43,6 +44,7 @@ public class Centrifuge { public Add(ICentrifugeRecipe recipe) { super(Centrifuge.name, RecipeManagers.centrifugeManager); recipes.add(recipe); + MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new CentrifugeRecipeWrapper(recipe)); } @Override @@ -79,6 +81,9 @@ public class Centrifuge { public Remove(List recipes) { super(Centrifuge.name, RecipeManagers.centrifugeManager, recipes); +// for(ICentrifugeRecipe recipe: recipes){ +// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new CentrifugeRecipeWrapper(recipe)); +// } } @Override diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java b/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java index 5ca21c0..b2d959d 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java @@ -5,6 +5,7 @@ import forestry.api.fuels.FuelManager; import forestry.api.recipes.IFermenterManager; import forestry.api.recipes.IFermenterRecipe; import forestry.api.recipes.RecipeManagers; +import forestry.factory.recipes.jei.fermenter.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; @@ -55,6 +56,7 @@ public class Fermenter { public Add(IFermenterRecipe recipe) { super(Fermenter.name, RecipeManagers.fermenterManager); recipes.add(recipe); + MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new FermenterRecipeWrapper(recipe, recipe.getResource())); } @Override @@ -97,6 +99,9 @@ public class Fermenter { public Remove(List recipes) { super(Fermenter.name, RecipeManagers.fermenterManager, recipes); +// for(IFermenterRecipe recipe: recipes){ +// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new FermenterRecipeWrapper(recipe, recipe.getResource())); +// } } @Override diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java b/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java index c15eabe..44d7a60 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java @@ -102,6 +102,9 @@ public class Squeezer { public Remove(List recipes) { super(Squeezer.name, RecipeManagers.squeezerManager, recipes); +// for(ISqueezerRecipe recipe: recipes){ +// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new SqueezerRecipeWrapper(recipe)); +// } } @Override diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Still.java b/src/main/java/modtweaker/mods/forestry/handlers/Still.java index b127108..21c131b 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Still.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Still.java @@ -2,6 +2,7 @@ package modtweaker.mods.forestry.handlers; import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; +import forestry.factory.recipes.jei.still.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.liquid.ILiquidStack; @@ -42,6 +43,7 @@ public class Still { public Add(IStillRecipe recipe) { super("Forestry Still", RecipeManagers.stillManager); recipes.add(recipe); + MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new StillRecipeWrapper(recipe)); } @Override @@ -84,6 +86,9 @@ public class Still { public Remove(List recipes) { super(Still.name, RecipeManagers.stillManager, recipes); +// for(IStillRecipe recipe: recipes){ +// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new StillRecipeWrapper(recipe)); +// } } @Override diff --git a/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java b/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java index 841de84..93bff7c 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java @@ -2,6 +2,7 @@ package modtweaker.mods.forestry.handlers; import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; +import forestry.factory.recipes.jei.fabricator.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import modtweaker.mods.forestry.*; @@ -78,6 +79,7 @@ public class ThermionicFabricator { public AddCast(IFabricatorRecipe recipe) { super(ThermionicFabricator.nameCasting, RecipeManagers.fabricatorManager); recipes.add(recipe); + MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new FabricatorRecipeWrapper(recipe)); } @Override @@ -148,6 +150,9 @@ public class ThermionicFabricator { public RemoveCasts(List recipes) { super(ThermionicFabricator.nameCasting, RecipeManagers.fabricatorManager, recipes); +// for(IFabricatorRecipe recipe: recipes){ +// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new FabricatorRecipeWrapper(recipe)); +// } } @Override From 9a182197b35e70ef5c512f07908a23249634977d Mon Sep 17 00:00:00 2001 From: laod Date: Sat, 4 Feb 2017 21:54:26 -0600 Subject: [PATCH 3/3] Improve forestry recipe JEI behavior. Moistener still broken. --- .../mods/forestry/ForestryListAddition.java | 12 +++++++- .../mods/forestry/ForestryListRemoval.java | 13 +++++++-- .../forestry/handlers/.Fermenter.java.swp | Bin 0 -> 4096 bytes .../mods/forestry/handlers/Carpenter.java | 15 +++++++--- .../mods/forestry/handlers/Centrifuge.java | 15 +++++++--- .../mods/forestry/handlers/Fermenter.java | 15 +++++++--- .../mods/forestry/handlers/Moistener.java | 13 +++++++++ .../mods/forestry/handlers/Squeezer.java | 14 +++++++-- .../mods/forestry/handlers/Still.java | 15 +++++++--- .../handlers/ThermionicFabricator.java | 27 +++++++++++++++--- 10 files changed, 113 insertions(+), 26 deletions(-) create mode 100644 src/main/java/modtweaker/mods/forestry/handlers/.Fermenter.java.swp diff --git a/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java b/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java index c6a19e6..7a2bb2e 100644 --- a/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java +++ b/src/main/java/modtweaker/mods/forestry/ForestryListAddition.java @@ -4,6 +4,7 @@ import com.blamejared.mtlib.helpers.LogHelper; import com.blamejared.mtlib.utils.BaseListAddition; import forestry.api.recipes.IForestryRecipe; import forestry.api.recipes.ICraftingProvider; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import java.util.*; @@ -25,6 +26,10 @@ public abstract class ForestryListAddition extends Ba if (recipe != null) { if (manager.addRecipe(recipe)){ successful.add(recipe); + IRecipeWrapper wrapped = wrapRecipe(recipe); + if (wrapped != null){ + MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(wrapped); + } } else { LogHelper.logError(String.format("Error adding %s Recipe for %s", name, getRecipeInfo(recipe))); } @@ -41,11 +46,16 @@ public abstract class ForestryListAddition extends Ba if (!manager.removeRecipe(recipe)) { LogHelper.logError(String.format("Error removing %s Recipe for %s", name, this.getRecipeInfo(recipe))); }else{ - MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(recipe); + IRecipeWrapper wrapped = wrapRecipe(recipe); + if (wrapped != null){ + MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(wrapped); + } } } else { LogHelper.logError(String.format("Error removing %s Recipe: null object", name)); } } } + + public abstract IRecipeWrapper wrapRecipe(T recipe); } diff --git a/src/main/java/modtweaker/mods/forestry/ForestryListRemoval.java b/src/main/java/modtweaker/mods/forestry/ForestryListRemoval.java index 9ee26ec..d878525 100644 --- a/src/main/java/modtweaker/mods/forestry/ForestryListRemoval.java +++ b/src/main/java/modtweaker/mods/forestry/ForestryListRemoval.java @@ -4,6 +4,7 @@ import forestry.api.recipes.ICraftingProvider; import forestry.api.recipes.IForestryRecipe; import com.blamejared.mtlib.helpers.LogHelper; import com.blamejared.mtlib.utils.BaseListRemoval; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import java.util.ArrayList; @@ -26,7 +27,10 @@ public abstract class ForestryListRemovall z^?mbGLdsJUvr~)oi;I%=a}zW3^s^Gn67_TQQ%ax`KxVOiT7FS#aY<37enw(mN=|A~ zvA$bsQEqBpNotWENCRQpMpcZ4z-S1-L!h)IP1k~#!Pv+UoYj?;6cvPpLgCV*jL{Gn d4S~@R7!85Z5Eu=C(GVC7fzc2c4T0ew0suU6E6xA_ literal 0 HcmV?d00001 diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java b/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java index a35a449..3e46582 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Carpenter.java @@ -5,6 +5,7 @@ import forestry.api.recipes.*; import forestry.core.recipes.ShapedRecipeCustom; import forestry.factory.recipes.CarpenterRecipeManager; import forestry.factory.recipes.jei.carpenter.*; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import minetweaker.api.liquid.ILiquidStack; @@ -57,7 +58,6 @@ public class Carpenter { public Add(ICarpenterRecipe recipe) { super(Carpenter.name, RecipeManagers.carpenterManager); recipes.add(recipe); - MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new CarpenterRecipeWrapper(recipe)); } // @Override @@ -85,6 +85,11 @@ public class Carpenter { protected String getRecipeInfo(ICarpenterRecipe recipe) { return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(ICarpenterRecipe recipe){ + return new CarpenterRecipeWrapper(recipe); + } } /** @@ -136,9 +141,6 @@ public class Carpenter { public Remove(List recipes) { super(Carpenter.name, RecipeManagers.carpenterManager, recipes); -// for(ICarpenterRecipe recipe: recipes){ -// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new CarpenterRecipeWrapper(recipe)); -// } } @Override @@ -156,5 +158,10 @@ public class Carpenter { protected String getRecipeInfo(ICarpenterRecipe recipe) { return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(ICarpenterRecipe recipe){ + return new CarpenterRecipeWrapper(recipe); + } } } diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java b/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java index db54587..f98f63c 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Centrifuge.java @@ -2,6 +2,7 @@ package modtweaker.mods.forestry.handlers; import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import modtweaker.mods.forestry.*; @@ -44,13 +45,17 @@ public class Centrifuge { public Add(ICentrifugeRecipe recipe) { super(Centrifuge.name, RecipeManagers.centrifugeManager); recipes.add(recipe); - MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new CentrifugeRecipeWrapper(recipe)); } @Override protected String getRecipeInfo(ICentrifugeRecipe recipe) { return LogHelper.getStackDescription(recipe.getInput()); } + + @Override + public IRecipeWrapper wrapRecipe(ICentrifugeRecipe recipe){ + return new CentrifugeRecipeWrapper(recipe); + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -81,14 +86,16 @@ public class Centrifuge { public Remove(List recipes) { super(Centrifuge.name, RecipeManagers.centrifugeManager, recipes); -// for(ICentrifugeRecipe recipe: recipes){ -// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new CentrifugeRecipeWrapper(recipe)); -// } } @Override protected String getRecipeInfo(ICentrifugeRecipe recipe) { return LogHelper.getStackDescription(recipe.getInput()); } + + @Override + public IRecipeWrapper wrapRecipe(ICentrifugeRecipe recipe){ + return new CentrifugeRecipeWrapper(recipe); + } } } diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java b/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java index b2d959d..e5d42a2 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Fermenter.java @@ -6,6 +6,7 @@ import forestry.api.recipes.IFermenterManager; import forestry.api.recipes.IFermenterRecipe; import forestry.api.recipes.RecipeManagers; import forestry.factory.recipes.jei.fermenter.*; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; @@ -56,13 +57,17 @@ public class Fermenter { public Add(IFermenterRecipe recipe) { super(Fermenter.name, RecipeManagers.fermenterManager); recipes.add(recipe); - MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new FermenterRecipeWrapper(recipe, recipe.getResource())); } @Override public String getRecipeInfo(IFermenterRecipe recipe) { return LogHelper.getStackDescription(recipe.getOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(IFermenterRecipe recipe){ + return new FermenterRecipeWrapper(recipe, recipe.getResource()); + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -99,15 +104,17 @@ public class Fermenter { public Remove(List recipes) { super(Fermenter.name, RecipeManagers.fermenterManager, recipes); -// for(IFermenterRecipe recipe: recipes){ -// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new FermenterRecipeWrapper(recipe, recipe.getResource())); -// } } @Override protected String getRecipeInfo(IFermenterRecipe recipe) { return LogHelper.getStackDescription(recipe.getOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(IFermenterRecipe recipe){ + return new FermenterRecipeWrapper(recipe, recipe.getResource()); + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Moistener.java b/src/main/java/modtweaker/mods/forestry/handlers/Moistener.java index a6e7f8f..dce608e 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Moistener.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Moistener.java @@ -4,6 +4,7 @@ import com.blamejared.mtlib.helpers.LogHelper; import com.blamejared.mtlib.utils.*; import forestry.api.fuels.*; import forestry.api.recipes.*; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import modtweaker.mods.forestry.*; @@ -47,6 +48,12 @@ public class Moistener { public String getRecipeInfo(IMoistenerRecipe recipe) { return LogHelper.getStackDescription(recipe.getProduct()); } + + //It's not clear to me how the moistener recipes should be wrapped + @Override + public IRecipeWrapper wrapRecipe(IMoistenerRecipe recipe){ + return null; + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -81,6 +88,12 @@ public class Moistener { public String getRecipeInfo(IMoistenerRecipe recipe) { return LogHelper.getStackDescription(recipe.getProduct()); } + + //It's not clear to me how the moistener recipes should be wrapped + @Override + public IRecipeWrapper wrapRecipe(IMoistenerRecipe recipe){ + return null; + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java b/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java index 44d7a60..dbad430 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Squeezer.java @@ -3,6 +3,7 @@ package modtweaker.mods.forestry.handlers; import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; import forestry.factory.recipes.jei.squeezer.*; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import minetweaker.api.liquid.ILiquidStack; @@ -54,6 +55,11 @@ public class Squeezer { public String getRecipeInfo(ISqueezerRecipe recipe) { return LogHelper.getStackDescription(recipe.getFluidOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(ISqueezerRecipe recipe){ + return new SqueezerRecipeWrapper(recipe); + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -102,14 +108,16 @@ public class Squeezer { public Remove(List recipes) { super(Squeezer.name, RecipeManagers.squeezerManager, recipes); -// for(ISqueezerRecipe recipe: recipes){ -// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new SqueezerRecipeWrapper(recipe)); -// } } @Override public String getRecipeInfo(ISqueezerRecipe recipe) { return LogHelper.getStackDescription(recipe.getFluidOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(ISqueezerRecipe recipe){ + return new SqueezerRecipeWrapper(recipe); + } } } diff --git a/src/main/java/modtweaker/mods/forestry/handlers/Still.java b/src/main/java/modtweaker/mods/forestry/handlers/Still.java index 21c131b..2546fa0 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/Still.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/Still.java @@ -3,6 +3,7 @@ package modtweaker.mods.forestry.handlers; import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; import forestry.factory.recipes.jei.still.*; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.IIngredient; import minetweaker.api.liquid.ILiquidStack; @@ -43,13 +44,17 @@ public class Still { public Add(IStillRecipe recipe) { super("Forestry Still", RecipeManagers.stillManager); recipes.add(recipe); - MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new StillRecipeWrapper(recipe)); } @Override public String getRecipeInfo(IStillRecipe recipe) { return LogHelper.getStackDescription(recipe.getOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(IStillRecipe recipe){ + return new StillRecipeWrapper(recipe); + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -86,14 +91,16 @@ public class Still { public Remove(List recipes) { super(Still.name, RecipeManagers.stillManager, recipes); -// for(IStillRecipe recipe: recipes){ -// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new StillRecipeWrapper(recipe)); -// } } @Override public String getRecipeInfo(IStillRecipe recipe) { return LogHelper.getStackDescription(recipe.getOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(IStillRecipe recipe){ + return new StillRecipeWrapper(recipe); + } } } diff --git a/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java b/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java index 93bff7c..6526769 100644 --- a/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java +++ b/src/main/java/modtweaker/mods/forestry/handlers/ThermionicFabricator.java @@ -3,6 +3,7 @@ package modtweaker.mods.forestry.handlers; import com.blamejared.mtlib.helpers.LogHelper; import forestry.api.recipes.*; import forestry.factory.recipes.jei.fabricator.*; +import mezz.jei.api.recipe.*; import minetweaker.MineTweakerAPI; import minetweaker.api.item.*; import modtweaker.mods.forestry.*; @@ -72,6 +73,12 @@ public class ThermionicFabricator { public String getRecipeInfo(IFabricatorSmeltingRecipe recipe) { return LogHelper.getStackDescription(recipe.getResource()); } + + //It's not clear to me how the smelting recipes should be wrapped + @Override + public IRecipeWrapper wrapRecipe(IFabricatorSmeltingRecipe recipe){ + return null; + } } private static class AddCast extends ForestryListAddition { @@ -79,13 +86,17 @@ public class ThermionicFabricator { public AddCast(IFabricatorRecipe recipe) { super(ThermionicFabricator.nameCasting, RecipeManagers.fabricatorManager); recipes.add(recipe); - MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(new FabricatorRecipeWrapper(recipe)); } @Override public String getRecipeInfo(IFabricatorRecipe recipe) { return LogHelper.getStackDescription(recipe.getRecipeOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(IFabricatorRecipe recipe){ + return new FabricatorRecipeWrapper(recipe); + } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -144,20 +155,28 @@ public class ThermionicFabricator { public String getRecipeInfo(IFabricatorSmeltingRecipe recipe) { return LogHelper.getStackDescription(recipe.getResource()); } + + //It's not clear to me how the smelting recipes should be wrapped + @Override + public IRecipeWrapper wrapRecipe(IFabricatorSmeltingRecipe recipe){ + return null; + } } private static class RemoveCasts extends ForestryListRemoval { public RemoveCasts(List recipes) { super(ThermionicFabricator.nameCasting, RecipeManagers.fabricatorManager, recipes); -// for(IFabricatorRecipe recipe: recipes){ -// MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(new FabricatorRecipeWrapper(recipe)); -// } } @Override public String getRecipeInfo(IFabricatorRecipe recipe) { return LogHelper.getStackDescription(recipe.getRecipeOutput()); } + + @Override + public IRecipeWrapper wrapRecipe(IFabricatorRecipe recipe){ + return new FabricatorRecipeWrapper(recipe); + } } }