|
1 | 1 | package io.github.fabriccompatibilitylayers.modremappingapi.impl.remapper; |
2 | 2 |
|
3 | | -import fr.catcore.modremapperapi.utils.Constants; |
4 | 3 | import net.fabricmc.loader.api.FabricLoader; |
5 | 4 | import net.fabricmc.loader.impl.launch.FabricLauncherBase; |
6 | 5 | import org.jetbrains.annotations.ApiStatus; |
@@ -49,8 +48,7 @@ public static void preloadClasses() { |
49 | 48 |
|
50 | 49 | for (String clazz : toCheck) { |
51 | 50 | try { |
52 | | - Constants.MAIN_LOGGER.info("Preloading class: " + clazz); |
53 | | - Class.forName(clazz, false, cl); |
| 51 | + if (!clazz.startsWith("META-INF.versions")) Class.forName(clazz, false, cl); |
54 | 52 | } catch (ClassNotFoundException | NoClassDefFoundError | UnsupportedClassVersionError e) { |
55 | 53 | if (!clazz.startsWith("META-INF.versions")) throw new RuntimeException(e); |
56 | 54 | } |
@@ -85,8 +83,8 @@ private static Stream<String> getEntries(String pkg, String locatorClass) throws |
85 | 83 | URL url = cl.getResource(locatorClass + ".class"); |
86 | 84 |
|
87 | 85 | URLConnection connection = url.openConnection(); |
88 | | - return connection instanceof JarURLConnection ? |
89 | | - ((JarURLConnection) connection).getJarFile().stream() |
| 86 | + return connection instanceof JarURLConnection jarConnection ? |
| 87 | + jarConnection.getJarFile().stream() |
90 | 88 | .filter(jarEntry -> jarEntry.getName().contains(pkg) && jarEntry.getName().endsWith(".class")) |
91 | 89 | .map(jarEntry -> jarEntry.getName().replace("/", ".").replace(".class", "")) |
92 | 90 | : Stream.empty(); |
|
0 commit comments