diff options
Diffstat (limited to 'src/main/java/lv/enes/mc/eris_alchemy/EMC.java')
| -rw-r--r-- | src/main/java/lv/enes/mc/eris_alchemy/EMC.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/lv/enes/mc/eris_alchemy/EMC.java b/src/main/java/lv/enes/mc/eris_alchemy/EMC.java index b8d5557..e34d28f 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/EMC.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/EMC.java | |||
| @@ -154,7 +154,11 @@ public class EMC { | |||
| 154 | return res; | 154 | return res; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | private OptionalDouble calculateEmcForRecipe(List<SimplifiedRecipe> recipes, Set<Item> configured, SimplifiedRecipe recipe) { | 157 | private OptionalDouble calculateEmcForRecipe( |
| 158 | List<SimplifiedRecipe> recipes, | ||
| 159 | Set<Item> configured, | ||
| 160 | SimplifiedRecipe recipe | ||
| 161 | ) { | ||
| 158 | try { | 162 | try { |
| 159 | if (recipe.inputs.isEmpty()) { | 163 | if (recipe.inputs.isEmpty()) { |
| 160 | return OptionalDouble.empty(); | 164 | return OptionalDouble.empty(); |
| @@ -191,7 +195,11 @@ public class EMC { | |||
| 191 | } | 195 | } |
| 192 | } | 196 | } |
| 193 | 197 | ||
| 194 | private OptionalDouble calculateEmcForIngredient(List<SimplifiedRecipe> recipes, Set<Item> configured, Ingredient ingredient) { | 198 | private OptionalDouble calculateEmcForIngredient( |
| 199 | List<SimplifiedRecipe> recipes, | ||
| 200 | Set<Item> configured, | ||
| 201 | Ingredient ingredient | ||
| 202 | ) { | ||
| 195 | return Arrays.stream(ingredient.getItems()) | 203 | return Arrays.stream(ingredient.getItems()) |
| 196 | .map(stack -> configEmc(recipes, configured, stack.getItem()).stream() | 204 | .map(stack -> configEmc(recipes, configured, stack.getItem()).stream() |
| 197 | .map(x -> x * stack.getCount()) | 205 | .map(x -> x * stack.getCount()) |