Fixed srv resolving not working in java 9+

This commit is contained in:
RaphiMC 2023-01-07 14:23:39 +01:00
parent a2956248dd
commit 40b266007a

View File

@ -44,6 +44,7 @@ public class ViaProxy {
transformerManager.addTransformer("net.raphimc.viaproxy.injection.transformer.**"); transformerManager.addTransformer("net.raphimc.viaproxy.injection.transformer.**");
transformerManager.addTransformer("net.raphimc.viaproxy.injection.mixins.**"); transformerManager.addTransformer("net.raphimc.viaproxy.injection.mixins.**");
final InjectionClassLoader injectionClassLoader = new InjectionClassLoader(transformerManager, ClassLoaders.getSystemClassPath()); final InjectionClassLoader injectionClassLoader = new InjectionClassLoader(transformerManager, ClassLoaders.getSystemClassPath());
injectionClassLoader.addProtectedPackage("com.sun.");
injectionClassLoader.setPriority(EnumLoaderPriority.PARENT_FIRST); injectionClassLoader.setPriority(EnumLoaderPriority.PARENT_FIRST);
injectionClassLoader.executeMain(ViaProxy.class.getName(), "injectedMain", args); injectionClassLoader.executeMain(ViaProxy.class.getName(), "injectedMain", args);
} }