Skip to content

Commit

Permalink
refactor: Set clientMods and javaPath with fallback-list and system e…
Browse files Browse the repository at this point in the history
…nvironemnt respectively, if the config is empty or an invalid javaPath was specified.
  • Loading branch information
Griefed committed Jul 22, 2021
1 parent db6dcd0 commit ff18c5e
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -848,11 +848,23 @@ public void mouseExited(java.awt.event.MouseEvent evt) {

textModpackDir.setText(config.getString("modpackDir"));

textClientMods.setText(CONFIGURATION.buildString(config.getStringList("clientMods").toString()));
if (config.getStringList("clientMods").isEmpty()) {
textClientMods.setText(CONFIGURATION.buildString(CONFIGURATION.getFallbackModsList().toString()));
// TODO: Replace with lang key
LOG.debug("Set clientMods from fallback list.");
} else {
textClientMods.setText(config.getStringList("clientMods").toString());
}

textCopyDirs.setText(CONFIGURATION.buildString(config.getStringList("copyDirs").toString().replace("\\","/")));

textJavaPath.setText(config.getString("javaPath"));
if (!CONFIGURATION.checkJavaPath(config.getString("javaPath"))) {
textJavaPath.setText(CONFIGURATION.getJavaPathFromSystem(""));
// TODO: Replace with lang key
LOG.debug("Set javaPath from system environment.");
} else {
textJavaPath.setText(config.getString("javaPath"));
}

textMinecraftVersion.setText(config.getString("minecraftVersion"));

Expand Down

0 comments on commit ff18c5e

Please sign in to comment.