From 99ebf025c6b6813f809ec45780799e74f766df92 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Mon, 3 Apr 2023 13:43:11 +0200 Subject: Fix RA2 bugs (#1830) * fix pulverizer chances mistakes * fix block version of the PBF * use properly RA2 for PBF recipes * spotlessApply (#1831) Co-authored-by: GitHub GTNH Actions <> * enable lots of materials by default * fixes, documentation, and minor api contract update * spotless --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> --- .../java/gregtech/api/interfaces/IGT_RecipeMap.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/main/java/gregtech/api/interfaces') diff --git a/src/main/java/gregtech/api/interfaces/IGT_RecipeMap.java b/src/main/java/gregtech/api/interfaces/IGT_RecipeMap.java index 69f87161d1..bbc2fd4ada 100644 --- a/src/main/java/gregtech/api/interfaces/IGT_RecipeMap.java +++ b/src/main/java/gregtech/api/interfaces/IGT_RecipeMap.java @@ -18,7 +18,13 @@ public interface IGT_RecipeMap { /** * Add a downstream recipe map that will get to handle the original builder. - * + * + * Downstream recipe maps got passed the recipe builder after parent recipe map is done with its business. Notice + * at this time the original recipe builder might be modified by the parent recipe map in some form, but it will + * remain as valid. + * + * A downstream will only be invoked if parent recipe map added something. + * * @param downstream */ void addDownstream(IGT_RecipeMap downstream); @@ -53,9 +59,13 @@ public interface IGT_RecipeMap { @Override public Collection doAdd(GT_RecipeBuilder builder) { List> ret = new ArrayList<>(); - ret.add(func.apply(builder)); - for (IGT_RecipeMap downstream : downstreams) { - ret.add(downstream.doAdd(builder)); + Collection out = func.apply(builder); + ret.add(out); + builder.clearInvalid(); + if (!out.isEmpty()) { + for (IGT_RecipeMap downstream : downstreams) { + ret.add(downstream.doAdd(builder)); + } } return GT_Utility.concat(ret); } -- cgit