aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
diff options
context:
space:
mode:
authorDaniel She <shekwancheung0528@gmail.com>2019-05-18 16:52:03 +0800
committerDaniel She <shekwancheung0528@gmail.com>2019-05-18 16:52:03 +0800
commita1f096436c208502fc6a94a6d290116f9cc2ce3b (patch)
treea3d300b1db7e7b637aa672bf06e2e27694c8039c /src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
parentc59d04ff79de7b5abbe7e1033a6283e0c29ed3d3 (diff)
parent375657a3770c04a6e073430d44c398751d22569a (diff)
downloadRoughlyEnoughItems-a1f096436c208502fc6a94a6d290116f9cc2ce3b.tar.gz
RoughlyEnoughItems-a1f096436c208502fc6a94a6d290116f9cc2ce3b.tar.bz2
RoughlyEnoughItems-a1f096436c208502fc6a94a6d290116f9cc2ce3b.zip
Merge branch '1.14-dev' into 1.14
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java')
-rw-r--r--src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
index db46aa08f..ba3b7ae9b 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
@@ -15,8 +15,8 @@ import net.minecraft.recipe.RecipeManager;
import net.minecraft.util.Identifier;
import java.awt.*;
-import java.util.*;
import java.util.List;
+import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@@ -257,15 +257,13 @@ public class RecipeHelperImpl implements RecipeHelper {
@Override
public Map<RecipeCategory, List<RecipeDisplay>> getAllRecipes() {
Map<RecipeCategory, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
- Map<Identifier, List<RecipeDisplay>> tempMap = Maps.newLinkedHashMap();
- recipeCategoryListMap.forEach((identifier, recipeDisplays) -> tempMap.put(identifier, new LinkedList<>(recipeDisplays)));
- categories.forEach(category -> {
- if (tempMap.containsKey(category.getIdentifier()))
- map.put(category, tempMap.get(category.getIdentifier()).stream().filter(display -> isDisplayVisible(display, true)).collect(Collectors.toList()));
+ categories.forEach(recipeCategory -> {
+ if (recipeCategoryListMap.containsKey(recipeCategory.getIdentifier())) {
+ List<RecipeDisplay> list = recipeCategoryListMap.get(recipeCategory.getIdentifier()).stream().filter(display -> isDisplayVisible(display, true)).collect(Collectors.toList());
+ if (!list.isEmpty())
+ map.put(recipeCategory, list);
+ }
});
- for(RecipeCategory category : map.keySet())
- if (map.get(category).isEmpty())
- map.remove(category);
return map;
}