Skip to content

Commit

Permalink
add .chancedOutputs builder call for List
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Aug 15, 2021
1 parent 5a40354 commit ecae98a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/gregtech/api/recipes/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,9 @@ public int getChance() {
public int getBoostPerTier() {
return boostPerTier;
}

public ChanceEntry copy() {
return new ChanceEntry(itemStack, chance, boostPerTier);
}
}
}
5 changes: 5 additions & 0 deletions src/main/java/gregtech/api/recipes/RecipeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ public R chancedOutput(MetaItem<?>.MetaValueItem item, int chance, int tierChanc
return chancedOutput(item, 1, chance, tierChanceBoost);
}

public R chancedOutputs(List<ChanceEntry> chancedOutputs) {
chancedOutputs.stream().map(ChanceEntry::copy).forEach(this.chancedOutputs::add);
return (R) this;
}

public R duration(int duration) {
this.duration = duration;
return (R) this;
Expand Down

0 comments on commit ecae98a

Please sign in to comment.