Skip to content

Commit

Permalink
Allow GT_NEI_AssLineHandler not being found for future removal (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune authored Feb 11, 2023
1 parent 2ff23e1 commit 73ab47a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public String getRecipeProcessorId() {
@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;
Expand Down Expand Up @@ -125,7 +125,7 @@ public List<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeInd
@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
Expand All @@ -141,4 +141,9 @@ public List<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIn
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));
}
}

0 comments on commit 73ab47a

Please sign in to comment.