From 14f068d3290db5b0210b49e2fb1d65d760b19002 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 12 Jan 2020 21:34:58 +0800 Subject: improved recipe screen type setting --- src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java') diff --git a/src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java b/src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java index 79a34a19f..6e22857bc 100644 --- a/src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java +++ b/src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java @@ -42,7 +42,6 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Optional; @Deprecated @Internal @@ -207,9 +206,11 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer { if (notice != null) ((VillagerRecipeViewingScreen) screen).addMainStackToNotice(notice); } else if (ConfigObject.getInstance().getRecipeScreenType() == RecipeScreenType.UNSET) { - screen = new PreRecipeViewingScreen(map); - if (notice != null) - ((PreRecipeViewingScreen) screen).addMainStackToNotice(notice); + screen = new PreRecipeViewingScreen(ScreenHelper.getLastContainerScreen(), RecipeScreenType.UNSET, true, original -> { + ConfigObject.getInstance().setRecipeScreenType(original ? RecipeScreenType.ORIGINAL : RecipeScreenType.VILLAGER); + ConfigManager.getInstance().saveConfig(); + openRecipeViewingScreen(map, notice); + }); } else { screen = new RecipeViewingScreen(map); if (notice != null) -- cgit