From 6e20fcb8c5a13d2145d8960a00b03507823c8d4d Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 18 Jun 2019 19:39:43 +0800 Subject: auto crafting... still using vanilla recipe book, can't figure how --- src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java') diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java index 56e9cf65b..0b4c4f821 100644 --- a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java +++ b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java @@ -205,6 +205,19 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer { return map.keySet().size() > 0; } + @Override + public boolean executeViewAllRecipesFromCategory(Identifier category) { + Map> map = Maps.newLinkedHashMap(); + Optional any = RecipeHelper.getInstance().getAllCategories().stream().filter(c -> c.getIdentifier().equals(category)).findAny(); + if (!any.isPresent()) + return false; + 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> map) { if (RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType == RecipeScreenType.VILLAGER) -- cgit