瀏覽代碼

Fix #462

Signed-off-by: shedaniel <daniel@shedaniel.me>
shedaniel 4 年之前
父節點
當前提交
e6d8e822b7

+ 9 - 1
RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/gui/DelegateScreen.java

@@ -256,17 +256,25 @@ public class DelegateScreen extends Screen {
         }
     }
     
+    private boolean init = true;
+    
     @Override
     public void init(Minecraft minecraft, int i, int j) {
         if (parent != null) {
             parent.init(minecraft, i, j);
         }
+        init = false;
+        super.init(minecraft, i, j);
     }
     
     @Override
     public void init() {
         if (parent != null) {
-            parent.init();
+            if (init) {
+                parent.init();
+            } else {
+                init = true;
+            }
         }
     }
     

+ 1 - 0
build.gradle

@@ -77,6 +77,7 @@ allprojects {
         modApi(fabricApi.module("fabric-networking-v0", project.fabric_api))
         modApi(fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api))
         modApi(fabricApi.module("fabric-rendering-fluids-v1", project.fabric_api))
+        modRuntime("net.fabricmc.fabric-api:fabric-api:${project.fabric_api}")
         modApi("me.shedaniel.cloth.api:cloth-client-events-v0:${cloth_client_events_v0_version}") {
             transitive(false)
         }

+ 2 - 2
gradle.properties

@@ -1,12 +1,12 @@
 org.gradle.jvmargs=-Xmx3G
-mod_version=5.9.0
+mod_version=5.9.1
 supported_version=1.16.2/3/4/5
 minecraft_version=1.16.4
 fabricloader_version=0.10.6+build.214
 cloth_client_events_v0_version=1.4.5
 cloth_config_version=4.8.3
 modmenu_version=1.14.6+build.31
-fabric_api=0.17.0+build.393-1.16
+fabric_api=0.30.0+1.16
 autoconfig1u=3.3.1
 api_include=me.shedaniel.cloth.api:cloth-client-events-v0,me.shedaniel.cloth:config-2,me.sargunvohra.mcmods:autoconfig1u,net.fabricmc.fabric-api:fabric-api-base
 api_exculde=