From ecae98a388ec75f1349a1de7f5e170ca7b347fa6 Mon Sep 17 00:00:00 2001 From: DStrand1 Date: Sat, 14 Aug 2021 19:14:34 -0500 Subject: [PATCH] add `.chancedOutputs` builder call for List --- src/main/java/gregtech/api/recipes/Recipe.java | 4 ++++ src/main/java/gregtech/api/recipes/RecipeBuilder.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/gregtech/api/recipes/Recipe.java b/src/main/java/gregtech/api/recipes/Recipe.java index 30d4f65335a..d2859a67f95 100644 --- a/src/main/java/gregtech/api/recipes/Recipe.java +++ b/src/main/java/gregtech/api/recipes/Recipe.java @@ -343,5 +343,9 @@ public int getChance() { public int getBoostPerTier() { return boostPerTier; } + + public ChanceEntry copy() { + return new ChanceEntry(itemStack, chance, boostPerTier); + } } } diff --git a/src/main/java/gregtech/api/recipes/RecipeBuilder.java b/src/main/java/gregtech/api/recipes/RecipeBuilder.java index 51f6c83ce74..e1f2c95a4d4 100644 --- a/src/main/java/gregtech/api/recipes/RecipeBuilder.java +++ b/src/main/java/gregtech/api/recipes/RecipeBuilder.java @@ -305,6 +305,11 @@ public R chancedOutput(MetaItem.MetaValueItem item, int chance, int tierChanc return chancedOutput(item, 1, chance, tierChanceBoost); } + public R chancedOutputs(List chancedOutputs) { + chancedOutputs.stream().map(ChanceEntry::copy).forEach(this.chancedOutputs::add); + return (R) this; + } + public R duration(int duration) { this.duration = duration; return (R) this;