diff options
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java index 0b4c4f821..268cbf578 100644 --- a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java +++ b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java @@ -219,6 +219,21 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer { } @Override + public boolean executeViewAllRecipesFromCategories(List<Identifier> categories) { + Map<RecipeCategory, List<RecipeDisplay>> map = Maps.newLinkedHashMap(); + for(Identifier category : categories) { + Optional<RecipeCategory> any = RecipeHelper.getInstance().getAllCategories().stream().filter(c -> c.getIdentifier().equals(category)).findAny(); + if (!any.isPresent()) + continue; + RecipeCategory<?> recipeCategory = any.get(); + map.put(recipeCategory, RecipeHelper.getInstance().getAllRecipesFromCategory(recipeCategory)); + } + if (map.keySet().size() > 0) + openRecipeViewingScreen(map); + return map.keySet().size() > 0; + } + + @Override public void openRecipeViewingScreen(Map<RecipeCategory, List<RecipeDisplay>> map) { if (RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType == RecipeScreenType.VILLAGER) MinecraftClient.getInstance().openScreen(new VillagerRecipeViewingScreen(map)); |
