Thread.sleep(100);
}
catch (InterruptedException ignore) { }
}
Applet applet = null;
try {
applet = MinecraftLauncher.getMinecraftApplet(Launcher.getGameUpdater().getBuild().getLibraries());
} catch (CorruptedMinecraftJarException corruption) {
corruption.printStackTrace();
} catch (MinecraftVerifyException verify) {
Launcher.clearCache();
JOptionPane.showMessageDialog(getParent(), "Your installation is corrupt, and has been cleaned. \nTry to login again.\n\n If that fails, close and restart this launcher.");
this.setVisible(false);
this.dispose();
Launcher.getLoginFrame().enableForm();
return;
}
if (applet == null) {
String message = "Failed to launch Spoutcraft!";
this.setVisible(false);
JOptionPane.showMessageDialog(getParent(), message);
this.dispose();
Launcher.getLoginFrame().enableForm();
return;
}
StartupParameters params = Utils.getStartupParameters();
minecraft = new MinecraftAppletEnglober(applet);
minecraft.addParameter("username", user);
minecraft.addParameter("sessionid", session);
minecraft.addParameter("downloadticket", downloadTicket);
minecraft.addParameter("spoutcraftlauncher", "true");
minecraft.addParameter("portable", params.isPortable() + "");
minecraft.addParameter("working_directory", Utils.getWorkingDirectory().getAbsolutePath());
if (params.getServer() != null) {
minecraft.addParameter("server", params.getServer());
if (params.getPort() != null) {
minecraft.addParameter("port", params.getPort());
} else {
minecraft.addParameter("port", "25565");
}
} else if (Settings.getDirectJoin() != null && Settings.getDirectJoin().length() > 0) {
String address = Settings.getDirectJoin();
String port = "25565";
if (address.contains(":")) {
String[] s = address.split(":");
address = s[0];
port = s[1];
}
minecraft.addParameter("server", address);
minecraft.addParameter("port", port);
}
if (params.getProxyHost() != null) {
minecraft.addParameter("proxy_host", params.getProxyHost());
}
if (params.getProxyPort() != null) {
minecraft.addParameter("proxy_port", params.getProxyPort());
}
if (params.getProxyUser() != null) {
minecraft.addParameter("proxy_user", params.getProxyUser());
}
if (params.getProxyPassword() != null) {
minecraft.addParameter("proxy_pass", params.getProxyPassword());
}
//minecraft.addParameter("fullscreen", WindowMode.getModeById(Settings.getWindowModeId()) == WindowMode.FULL_SCREEN ? "true" : "false");
applet.setStub(minecraft);
this.add(minecraft);
validate();
this.setVisible(true);
// TODO: Incredibly hacky fix for grey screens due to Minecraft not making the resources directory.