aboutsummaryrefslogtreecommitdiff
path: root/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java')
-rw-r--r--RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
index 60914d080..1352d7656 100644
--- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
+++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java
@@ -260,7 +260,15 @@ public class ScreenHelper implements ClientModInitializer, REIHelper {
public void onInitializeClient() {
ClothClientHooks.SCREEN_INIT_PRE.register((client, screen, screenHooks) -> {
if ((!RoughlyEnoughItemsState.getErrors().isEmpty() || !RoughlyEnoughItemsState.getWarnings().isEmpty()) && !(screen instanceof WarningAndErrorScreen)) {
- WarningAndErrorScreen warningAndErrorScreen = WarningAndErrorScreen.INSTANCE.get();
+ WarningAndErrorScreen warningAndErrorScreen = new WarningAndErrorScreen("initialization", RoughlyEnoughItemsState.getWarnings(), RoughlyEnoughItemsState.getErrors(), (parent) -> {
+ if (RoughlyEnoughItemsState.getErrors().isEmpty()) {
+ RoughlyEnoughItemsState.clear();
+ RoughlyEnoughItemsState.continues();
+ Minecraft.getInstance().setScreen(parent);
+ } else {
+ Minecraft.getInstance().stop();
+ }
+ });
warningAndErrorScreen.setParent(screen);
try {
if (client.screen != null) client.screen.removed();