mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-18 19:39:14 +00:00
Fix canonical service fetcher method, updates #210
This commit is contained in:
1 parent
164e471dcd
commit
03d1ad54f8
1 file changed
+5
-2
@@ -65,9 +65,12 @@ public final class MixinService {
|
||||
ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
|
||||
if (MixinService.class.getClassLoader() != systemClassLoader) {
|
||||
try {
|
||||
String self = Thread.currentThread().getStackTrace()[1].getMethodName();
|
||||
Class<?> contextServiceClass = Class.forName(MixinService.class.getName(), true, systemClassLoader);
|
||||
Method mdGetInstance = contextServiceClass.getMethod("getInstance");
|
||||
MixinService.instance = (MixinService)mdGetInstance.invoke(null);
|
||||
if (contextServiceClass != MixinService.class) {
|
||||
Method mdGetInstance = contextServiceClass.getDeclaredMethod(self);
|
||||
MixinService.instance = (MixinService)mdGetInstance.invoke(null);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user