aboutsummaryrefslogtreecommitdiff
path: root/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-08-05 17:14:07 +0800
committershedaniel <daniel@shedaniel.me>2020-08-05 17:14:07 +0800
commit8a2df51193fd3db145f3b1ace974e9e0a0bc09a5 (patch)
tree894244ea7e84d9bd78748e4e295e528cfc9e7979 /RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
parent1ce5ca77bc2f98df6cc370c96547c2c39c1fd897 (diff)
downloadRoughlyEnoughItems-8a2df51193fd3db145f3b1ace974e9e0a0bc09a5.tar.gz
RoughlyEnoughItems-8a2df51193fd3db145f3b1ace974e9e0a0bc09a5.tar.bz2
RoughlyEnoughItems-8a2df51193fd3db145f3b1ace974e9e0a0bc09a5.zip
REI 5.1.0:
- Improve auto crafting, now able to detect things on the grid - Introduce getResultingEntries as a replacement for getOutputEntries, it can now handle lists of lists of stacks - Caching for fluid hashing - Full fractions support for simple recipe display - Made searchFavorites defaulted false Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java')
-rw-r--r--RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
index 10234146c..553a42813 100644
--- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
+++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
@@ -98,7 +98,7 @@ public class RecipeHelperImpl implements RecipeHelper {
}
}
if (slotsCraftable == recipeDisplay.getRequiredEntries().size())
- craftables.addAll(recipeDisplay.getOutputEntries());
+ recipeDisplay.getResultingEntries().stream().flatMap(Collection::stream).collect(Collectors.toCollection(() -> craftables));
}
return craftables.stream().distinct().collect(Collectors.toList());
}
@@ -175,12 +175,14 @@ public class RecipeHelperImpl implements RecipeHelper {
for (RecipeDisplay display : allRecipesFromCategory) {
if (!isDisplayVisible(display)) continue;
if (!recipesFor.isEmpty()) {
- label:
- for (EntryStack outputStack : display.getOutputEntries()) {
- for (EntryStack stack : recipesFor) {
- if (stack.equals(outputStack)) {
- set.add(display);
- break label;
+ back:
+ for (List<EntryStack> results : display.getResultingEntries()) {
+ for (EntryStack otherEntry : results) {
+ for (EntryStack stack : recipesFor) {
+ if (otherEntry.equals(stack)) {
+ set.add(display);
+ break back;
+ }
}
}
}