diff --git a/dependencies.gradle b/dependencies.gradle index bf4352d..9f6ba75 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -14,6 +14,7 @@ dependencies { compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.37:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:GTplusplus:1.7.90:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.3.19-GTNH:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Botania:1.9.11-GTNH:dev") { transitive = false } compileOnly("com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev") { transitive = false } compileOnly("curse.maven:thaumcraft-nei-plugin-225095:2241913") { transitive = false } compileOnly("curse.maven:thermal-expansion-69163:2388759") { transitive = false } diff --git a/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java b/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java index 9498c25..215548f 100644 --- a/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java +++ b/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java @@ -274,7 +274,7 @@ public static void setTransformBlacklist(String[] transformBlacklist) { public static void setTransformPriorityList(String[] transformPriorityList) { NEEConfig.transformPriorityList = transformPriorityList; - config.get("client", "transformPriorityModList", new String[0], "if oredict has this mod's item, use it first") + config.get("client", "transformItemPriorityList", new String[0], "if oredict has this mod's item, use it first") .set(transformPriorityList); config.save(); } diff --git a/src/main/java/com/github/vfyjxf/nee/processor/BotaniaRecipeProcessor.java b/src/main/java/com/github/vfyjxf/nee/processor/BotaniaRecipeProcessor.java new file mode 100644 index 0000000..737306a --- /dev/null +++ b/src/main/java/com/github/vfyjxf/nee/processor/BotaniaRecipeProcessor.java @@ -0,0 +1,50 @@ +package com.github.vfyjxf.nee.processor; + +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.IRecipeHandler; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import javax.annotation.Nonnull; +import vazkii.botania.client.integration.nei.recipe.RecipeHandlerLexicaBotania; + +public class BotaniaRecipeProcessor implements IRecipeProcessor { + @Nonnull + @Override + public Set getAllOverlayIdentifier() { + return Collections.singleton(RecipeProcessor.NULL_IDENTIFIER); + } + + @Nonnull + @Override + public String getRecipeProcessorId() { + return " Botania"; + } + + @Nonnull + @Override + public List getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) { + List recipeInputs = new ArrayList<>(); + if (recipe instanceof RecipeHandlerLexicaBotania) { + // we don't need to get recipe from a book. + // but botania doesn't provide an identifier for each recipe handler, so the button will still show. + return recipeInputs; + } + recipeInputs.addAll(recipe.getIngredientStacks(recipeIndex)); + return recipeInputs; + } + + @Nonnull + @Override + public List getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) { + List recipeOutputs = new ArrayList<>(); + if (recipe instanceof RecipeHandlerLexicaBotania) { + // we don't need to get recipe from a book. + // but botania doesn't provide an identifier for each recipe handler, so the button will still show. + return recipeOutputs; + } + recipeOutputs.add(recipe.getResultStack(recipeIndex)); + return recipeOutputs; + } +} diff --git a/src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java b/src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java index 1886e82..341de43 100644 --- a/src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java +++ b/src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java @@ -20,6 +20,11 @@ public static void init() { recipeProcessors.add(new AppengRecipeProcessor()); } + if (Loader.isModLoaded("Botania")) { + NotEnoughEnergistics.logger.info("Found Botania,install Botania support"); + recipeProcessors.add(new BotaniaRecipeProcessor()); + } + if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi")) { NotEnoughEnergistics.logger.info("Found GregTech5,install GregTech5 support"); recipeProcessors.add(new GregTech5RecipeProcessor());