Add GoodGenerator compat

This commit is contained in:
miozune committed 2022-07-12 21:41:53 +09:00
1 parent ab7113b815
commit d066fa13ba
2 files changed
+58

No files matched your search

@@ -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<String> 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<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) {
List<PositionedStack> 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<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) {
List<PositionedStack> 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;
}
}
@@ -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-----");
}