aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-08-28 16:01:34 +0800
committershedaniel <daniel@shedaniel.me>2021-08-28 16:01:42 +0800
commit8a0601c75fa2462494ed949797f04243fe9cb10e (patch)
treed68bb62284aa8f63faecb5060b9803846f33ed72 /runtime
parent2318a37d8482498bdec25947e15177ba77996cb8 (diff)
downloadRoughlyEnoughItems-8a0601c75fa2462494ed949797f04243fe9cb10e.tar.gz
RoughlyEnoughItems-8a0601c75fa2462494ed949797f04243fe9cb10e.tar.bz2
RoughlyEnoughItems-8a0601c75fa2462494ed949797f04243fe9cb10e.zip
Fix crash if architectury isn't installed, fix replay mod and REI fighting to show GUIs
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java
index 0914ac6f6..c7da5737a 100644
--- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java
+++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java
@@ -26,6 +26,7 @@ package me.shedaniel.rei;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.fabricmc.api.EnvType;
+import java.lang.invoke.MethodHandles;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -63,7 +64,7 @@ public class RoughlyEnoughItemsInitializer {
} catch (NoSuchMethodException ignored) {
}
if (method != null) {
- method.invoke(instance);
+ MethodHandles.lookup().unreflect(method).bindTo(instance).invoke();
}
}
} else {
@@ -72,7 +73,7 @@ public class RoughlyEnoughItemsInitializer {
} catch (NoSuchMethodException ignored) {
}
if (method != null) {
- method.invoke(instance);
+ MethodHandles.lookup().unreflect(method).bindTo(instance).invoke();
}
}
} catch (Throwable e) {