Allow GT_NEI_AssLineHandler not being found for future removal (#30)

This commit is contained in:
miozune authored and GitHub committed 2023-02-11 11:06:08 +01:00
1 parent 2ff23e1ecc
commit 73ab47a770
2 files changed
+9 -2

No files matched your search

@@ -18,6 +18,8 @@ public class GTPPRecipeProcessor implements IRecipeProcessor {
public Set<String> getAllOverlayIdentifier() {
HashSet<String> identifiers = new HashSet<>(Collections.singletonList("GTPP_Decayables"));
// GTNH version of GT++ deprecated this, but other versions still use it
// noinspection deprecation
for (GTPP_Recipe.GTPP_Recipe_Map_Internal gtppMap : GTPP_Recipe.GTPP_Recipe_Map_Internal.sMappingsEx) {
if (gtppMap.mNEIAllowed) {
identifiers.add(gtppMap.mNEIName);
@@ -84,7 +84,7 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
@Override
public List<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) {
List<PositionedStack> recipeInputs = new ArrayList<>();
if (gtDefaultClz.isInstance(recipe) || gtAssLineClz.isInstance(recipe)) {
if (canProcessRecipe(recipe)) {
if (GuiUtils.isFluidCraftPatternTermEx(Minecraft.getMinecraft().currentScreen)) {
boolean priority = ((GuiFluidPatternTerminalEx) Minecraft
.getMinecraft().currentScreen).container.prioritize;
@@ -125,7 +125,7 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
@Override
public List<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) {
List<PositionedStack> recipeOutputs = new ArrayList<>();
if (gtDefaultClz.isInstance(recipe) || gtAssLineClz.isInstance(recipe)) {
if (canProcessRecipe(recipe)) {
recipeOutputs.addAll(recipe.getOtherStacks(recipeIndex));
recipeOutputs.removeIf(positionedStack -> getFluidFromDisplayStack(positionedStack.items[0]) != null);
// remove output if it's chance != 10000
@@ -141,4 +141,9 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
public boolean mergeStacks(IRecipeHandler recipe, int recipeIndex, String identifier) {
return !"gt.recipe.fakeAssemblylineProcess".equals(identifier);
}
private boolean canProcessRecipe(IRecipeHandler recipe) {
return (gtDefaultClz != null && gtDefaultClz.isInstance(recipe))
|| (gtAssLineClz != null && gtAssLineClz.isInstance(recipe));
}
}