diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-08-28 20:01:47 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-08-28 20:01:47 +0800 |
| commit | 614a8ef48584740ddbcd6ece4f7e7bbe139e755b (patch) | |
| tree | ce2042398fa09ae22e2a14ca658d1dfed514eef5 /RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ScreenHelper.java | |
| parent | ff9c8e83f0eaf3791e4939b491979d23bdca5577 (diff) | |
| download | RoughlyEnoughItems-614a8ef48584740ddbcd6ece4f7e7bbe139e755b.tar.gz RoughlyEnoughItems-614a8ef48584740ddbcd6ece4f7e7bbe139e755b.tar.bz2 RoughlyEnoughItems-614a8ef48584740ddbcd6ece4f7e7bbe139e755b.zip | |
Detect a good optifabric instance, it should support Chocohead/OptiFabric
Signed-off-by: shedaniel <daniel@shedaniel.me>
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.java | 10 |
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(); |
