aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-06-18 19:39:43 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-06-18 19:39:43 +0800
commit6e20fcb8c5a13d2145d8960a00b03507823c8d4d (patch)
treeea7188c9e8136e3778ba938d93515559ad423bbf /src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java
parent332747a3332eec2f2bff5696f79ef1e38161aa75 (diff)
downloadRoughlyEnoughItems-6e20fcb8c5a13d2145d8960a00b03507823c8d4d.tar.gz
RoughlyEnoughItems-6e20fcb8c5a13d2145d8960a00b03507823c8d4d.tar.bz2
RoughlyEnoughItems-6e20fcb8c5a13d2145d8960a00b03507823c8d4d.zip
auto crafting... still using vanilla recipe book, can't figure how
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java')
-rw-r--r--src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java13
1 files changed, 13 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 56e9cf65b..0b4c4f821 100644
--- a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java
@@ -206,6 +206,19 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer {
}
@Override
+ public boolean executeViewAllRecipesFromCategory(Identifier category) {
+ Map<RecipeCategory, List<RecipeDisplay>> map = Maps.newLinkedHashMap();
+ Optional<RecipeCategory> 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<RecipeCategory, List<RecipeDisplay>> map) {
if (RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType == RecipeScreenType.VILLAGER)
MinecraftClient.getInstance().openScreen(new VillagerRecipeViewingScreen(map));