diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-05-18 16:51:55 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-05-18 16:51:55 +0800 |
| commit | 375657a3770c04a6e073430d44c398751d22569a (patch) | |
| tree | a3d300b1db7e7b637aa672bf06e2e27694c8039c /src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java | |
| parent | 2a22249e3394e47b11b338f2fc6b03475ad7a54f (diff) | |
| download | RoughlyEnoughItems-375657a3770c04a6e073430d44c398751d22569a.tar.gz RoughlyEnoughItems-375657a3770c04a6e073430d44c398751d22569a.tar.bz2 RoughlyEnoughItems-375657a3770c04a6e073430d44c398751d22569a.zip | |
Build 112
Fix #88
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java | 16 |
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; } |
