diff --git a/src/main/java/com/github/vfyjxf/nee/processor/GoodGeneratorRecipeProcessor.java b/src/main/java/com/github/vfyjxf/nee/processor/GoodGeneratorRecipeProcessor.java new file mode 100644 index 0000000..97d2dac --- /dev/null +++ b/src/main/java/com/github/vfyjxf/nee/processor/GoodGeneratorRecipeProcessor.java @@ -0,0 +1,54 @@ +package com.github.vfyjxf.nee.processor; + +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.IRecipeHandler; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class GoodGeneratorRecipeProcessor implements IRecipeProcessor { + + @Nonnull + @Override + public Set getAllOverlayIdentifier() { + return new HashSet<>(Arrays.asList( + "gg.recipe.neutron_activator", + "gg.recipe.precise_assembler" + + )); + } + + @Nonnull + @Override + public String getRecipeProcessorId() { + return "Good Generator"; + } + + @Nonnull + @Override + public List getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) { + List recipeInputs = new ArrayList<>(); + if (this.getAllOverlayIdentifier().contains(identifier)) { + recipeInputs.addAll(recipe.getIngredientStacks(recipeIndex)); + recipeInputs.removeIf(positionedStack -> GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0]) != null || positionedStack.item.stackSize == 0); + return recipeInputs; + } + return recipeInputs; + } + + @Nonnull + @Override + public List getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) { + List recipeOutputs = new ArrayList<>(); + if (this.getAllOverlayIdentifier().contains(identifier)) { + recipeOutputs.addAll(recipe.getOtherStacks(recipeIndex)); + recipeOutputs.removeIf(positionedStack -> GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0]) != null); + return recipeOutputs; + } + 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 07bb1b1..44875e6 100644 --- a/src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java +++ b/src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java @@ -74,6 +74,10 @@ public class RecipeProcessor { NotEnoughEnergistics.logger.info("Found GT++, install GT++ support"); recipeProcessors.add(new GTPPRecipeProcessor()); } + if (Loader.isModLoaded("GoodGenerator")) { + NotEnoughEnergistics.logger.info("Found Good Generator, install Good Generator support"); + recipeProcessors.add(new GoodGeneratorRecipeProcessor()); + } NotEnoughEnergistics.logger.info("-----Not Enough Energistics Init Finished-----"); }