Skip to content

Commit 7365e6f

Browse files
committed
Revert "add stage 2 compatibility for FabricLoader subclasses e.g. lunar client"
This reverts commit e3b6f26.
1 parent e3b6f26 commit 7365e6f

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

stage2/fabric/src/main/java/gg/essential/loader/stage2/EssentialLoader.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -347,26 +347,10 @@ private Object createCandidate(Path path, URL url, Object metadata) throws Class
347347
}
348348
}
349349

350-
private Class<?> findFabricLoaderClass(FabricLoader fabricLoader) throws ClassNotFoundException {
351-
Class<?> clazz = fabricLoader.getClass();
352-
while (clazz != null) {
353-
try {
354-
clazz.getDeclaredField("modMap");
355-
clazz.getDeclaredField("mods");
356-
clazz.getDeclaredField("entrypointStorage");
357-
clazz.getDeclaredField("adapterMap");
358-
return clazz;
359-
} catch (NoSuchFieldException ignored) {
360-
clazz = clazz.getSuperclass();
361-
}
362-
}
363-
throw new ClassNotFoundException("Could not find the required fields [modMap, mods, entrypointStorage, adapterMap] anywhere in the class hierarchy of FabricLoader.getInstance()");
364-
}
365-
366350
@SuppressWarnings("unchecked")
367351
private void injectFakeMod(final Path path, final URL url, final ModMetadata metadata) throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, ClassNotFoundException, InstantiationException {
368352
FabricLoader fabricLoader = FabricLoader.getInstance();
369-
Class<?> fabricLoaderClass = findFabricLoaderClass(fabricLoader);
353+
Class<? extends FabricLoader> fabricLoaderClass = fabricLoader.getClass();
370354
Class<?> ModContainerImpl;
371355
try {
372356
// fabric-loader 0.12

0 commit comments

Comments
 (0)