mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-17 02:45:29 +00:00
Add GoodGenerator compat
This commit is contained in:
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-----");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user