Skip to content

Commit

Permalink
Add comment on the zeroing of the recipemap copy EUt and duration
Browse files Browse the repository at this point in the history
self documenting code bad
  • Loading branch information
PrototypeTrousers committed Aug 10, 2022
1 parent f03d8f2 commit 4131c82
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/gregtech/api/recipes/logic/ParallelLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,13 @@ public static RecipeBuilder<?> appendItemRecipes(RecipeMap<?> recipeMap, IItemHa
if (matchingRecipe != null) {
inputIngredient = matchingRecipe.getInputs().get(0);
if (recipeBuilder == null) {
recipeBuilder = recipeMap.recipeBuilder().EUt(0);
//here we make a copy of the recipe builder of the current recipe map, while zeroing
//the recipe builder EUt, since we're going to add to the total EUt of the recipes appended.
//not zeroing means there is a base cost of 1 recipe EUt while doing parallel recipes
//for example running 2 parallel recipes would cost the EUt of doing 3 recipes.
//same should apply for the recipe map duration
recipeBuilder = recipeMap.recipeBuilder().EUt(0).duration(0);

}
} else
continue;
Expand Down

0 comments on commit 4131c82

Please sign in to comment.