Add in support for setting the home dir via the applet launch, also a system property for forcing the home dir

This commit is contained in:
Christian committed 2012-08-15 17:18:11 -04:00
1 parent 96b78514a8
commit ba902537ca
1 file changed
+3 -2
@@ -228,7 +228,8 @@ public class FMLRelauncher
newApplet = appletClass.newInstance();
Object appletContainer = ReflectionHelper.getPrivateValue(ReflectionHelper.getClass(getClass().getClassLoader(), "java.awt.Component"), minecraftApplet, "parent");
Class<? super Object> launcherClass = ReflectionHelper.getClass(getClass().getClassLoader(), "net.minecraft.Launcher");
String launcherClassName = System.getProperty("minecraft.applet.WrapperClass", "net.minecraft.Launcher");
Class<? super Object> launcherClass = ReflectionHelper.getClass(getClass().getClassLoader(), launcherClassName);
if (launcherClass.isInstance(appletContainer))
{
ReflectionHelper.findMethod(ReflectionHelper.getClass(getClass().getClassLoader(), "java.awt.Container"), minecraftApplet, new String[] { "removeAll" }).invoke(appletContainer);
@@ -236,7 +237,7 @@ public class FMLRelauncher
}
else
{
FMLRelaunchLog.severe("Found unknown applet parent %s, unable to inject!\n", launcherClass);
FMLRelaunchLog.severe("Found unknown applet parent %s, unable to inject!\n", appletContainer.getClass().getName());
throw new RuntimeException();
}
}