mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
1 parent
508d872ef3
commit
19abf0cb9a
1 file changed
+7
-3
@@ -28,6 +28,7 @@ import cpw.mods.modlauncher.Launcher;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.Proxy;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
@@ -122,9 +123,12 @@ public class LaunchTesting
|
||||
// hack the classloader now.
|
||||
try
|
||||
{
|
||||
final Field sysPathsField = ClassLoader.class.getDeclaredField("sys_paths");
|
||||
sysPathsField.setAccessible(true);
|
||||
sysPathsField.set(null, null);
|
||||
final Method initializePathMethod = ClassLoader.class.getDeclaredMethod("initializePath", String.class);
|
||||
initializePathMethod.setAccessible(true);
|
||||
final Object usrPathsValue = initializePathMethod.invoke(null, "java.library.path");
|
||||
final Field usrPathsField = ClassLoader.class.getDeclaredField("usr_paths");
|
||||
usrPathsField.setAccessible(true);
|
||||
usrPathsField.set(null, usrPathsValue);
|
||||
}
|
||||
catch(Throwable t) {}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user