diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-01-12 21:34:58 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-01-12 21:34:58 +0800 |
| commit | 14f068d3290db5b0210b49e2fb1d65d760b19002 (patch) | |
| tree | 1dc4993956690da65ddb7f0defd0f4b3e6acf910 /src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java | |
| parent | 421d0b0abd703367d6078f344def91ddfa24bdec (diff) | |
| download | RoughlyEnoughItems-14f068d3290db5b0210b49e2fb1d65d760b19002.tar.gz RoughlyEnoughItems-14f068d3290db5b0210b49e2fb1d65d760b19002.tar.bz2 RoughlyEnoughItems-14f068d3290db5b0210b49e2fb1d65d760b19002.zip | |
improved recipe screen type setting
Diffstat (limited to 'src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java | 9 |
1 files changed, 5 insertions, 4 deletions
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) |
