diff --git a/fml/common/cpw/mods/fml/relauncher/FMLEmbeddingRelauncher.java b/fml/common/cpw/mods/fml/relauncher/FMLEmbeddingRelauncher.java
index 417656436..98230afbb 100644
--- a/fml/common/cpw/mods/fml/relauncher/FMLEmbeddingRelauncher.java
+++ b/fml/common/cpw/mods/fml/relauncher/FMLEmbeddingRelauncher.java
@@ -2,13 +2,22 @@ package cpw.mods.fml.relauncher;
import java.applet.Applet;
import java.applet.AppletStub;
+import java.awt.Dialog.ModalityType;
+import java.awt.HeadlessException;
import java.io.File;
+import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URLClassLoader;
import java.util.Arrays;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.ProgressMonitorInputStream;
+
import net.minecraft.src.WorldSettings;
public class FMLEmbeddingRelauncher
@@ -18,18 +27,21 @@ public class FMLEmbeddingRelauncher
private Object newApplet;
private Class super Object> appletClass;
+ private JDialog popupWindow;
+
public static void relaunch(ArgsWrapper wrap)
{
instance().relaunchClient(wrap);
}
- private static FMLEmbeddingRelauncher instance()
+ static FMLEmbeddingRelauncher instance()
{
if (INSTANCE == null)
{
INSTANCE = new FMLEmbeddingRelauncher();
}
return INSTANCE;
+
}
private FMLEmbeddingRelauncher()
@@ -37,15 +49,38 @@ public class FMLEmbeddingRelauncher
URLClassLoader ucl = (URLClassLoader)getClass().getClassLoader();
clientLoader = new RelaunchClassLoader(ucl.getURLs());
+
+ try
+ {
+ popupWindow = new JDialog(null, "FML Initial Setup", ModalityType.MODELESS);
+ JOptionPane optPane = new JOptionPane("FML Setup
FML is performing some configuration, please wait", JOptionPane.INFORMATION_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new Object[0]);
+ popupWindow.add(optPane);
+ popupWindow.pack();
+ popupWindow.setLocationRelativeTo(null);
+ popupWindow.setVisible(true);
+ }
+ catch (Exception e)
+ {
+ popupWindow = null;
+ }
}
private void relaunchClient(ArgsWrapper wrap)
{
- File minecraftHome = setupHome();
-
// Now we re-inject the home into the "new" minecraft under our control
- Class super Object> client = ReflectionHelper.getClass(clientLoader, "net.minecraft.client.Minecraft");
- ReflectionHelper.setPrivateValue(client, null, minecraftHome, "field_6275_Z", "ap", "minecraftDir");
+ Class super Object> client;
+ try
+ {
+ File minecraftHome = setupHome();
+
+ client = ReflectionHelper.getClass(clientLoader, "net.minecraft.client.Minecraft");
+ ReflectionHelper.setPrivateValue(client, null, minecraftHome, "field_6275_Z", "ap", "minecraftDir");
+ }
+ finally
+ {
+ popupWindow.setVisible(false);
+ popupWindow.dispose();
+ }
try
{
@@ -75,7 +110,28 @@ public class FMLEmbeddingRelauncher
FMLLog.minecraftHome = minecraftHome;
FMLLog.info("FML relaunch active");
- RelaunchLibraryManager.handleLaunch(minecraftHome, clientLoader);
+ try
+ {
+ RelaunchLibraryManager.handleLaunch(minecraftHome, clientLoader);
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ String logFile = new File(minecraftHome,"ForgeModLoader-0.log").getCanonicalPath();
+ JOptionPane.showMessageDialog(popupWindow,
+ String.format("