trayMenu.updateLocale();
}
}
public void doLaunch () {
JavaInfo java = Settings.getSettings().getCurrentJava();
ModPack pack = ModPack.getSelectedPack();
// check launcher version
if (ModPack.getSelectedPack().getMinLaunchSpec() > Constants.buildNumber) {
ErrorUtils.tossError("Please update your launcher in order to launch this pack! This can be done by restarting your launcher, an update dialog will pop up.");
return;
}
// check if user profile is selected
if (users.getSelectedIndex() <= 1) {
if (UserManager._users.size() == 0) {
ProfileAdderDialog p = new ProfileAdderDialog(getInstance(), true);
p.setVisible(true);
} else {
ErrorUtils.tossError("Please select a profile!");
return;
}
}
// check selected java is at least version specified in pack's XML
int[] minSup = pack.getMinJRE();
if (minSup.length >= 2 && minSup[0] <= java.getMajor() && minSup[1] <= java.getMinor()) {
Settings.getSettings().setLastFTBPack(ModPack.getSelectedPack(true).getDir());
Settings.getSettings().setLastThirdPartyPack(ModPack.getSelectedPack(false).getDir());
saveSettings();
doLogin(UserManager.getUsername(users.getSelectedItem().toString()), UserManager.getPassword(users.getSelectedItem().toString()),
UserManager.getMojangData(users.getSelectedItem().toString()), UserManager.getName(users.getSelectedItem().toString()));
} else {//user can't run pack-- JRE not high enough
ErrorUtils.tossError("You must use at least java " + minSup[0] + "." + minSup[1] + " to play this pack! Please go to Options to get a link or Advanced Options enter a path.",
java.toString());
return;
}
}