Adds various fixes to make the two java versions work as expected

Makes it possible to load a controller without generating a GUI, for better testing
Makes sure not to try and parse empty profile lines
Saves controller settings in a more readable and appendable format
Adds code for using the correct java version for the occasion
Adds a new function for writing to files
This commit is contained in:
2021-08-02 21:06:22 +02:00
parent 6ec44f1f92
commit f1eead3807
21 changed files with 350 additions and 136 deletions

View File

@ -8,7 +8,7 @@ import net.knarcraft.minecraftserverlauncher.utility.CommonFunctions;
import javax.naming.ConfigurationException;
import javax.swing.*;
import java.io.*;
import java.io.IOException;
import java.util.ArrayList;
/**
@ -230,7 +230,9 @@ public class Profile {
*/
public static Profile fromString(String profileString) throws ConfigurationException {
Profile profile;
if (profileString.contains("?")) {
if (profileString.equals("")) {
return null;
} else if (profileString.contains("?")) {
String[] data = profileString.split("\\?");
String[] profileData = data[0].split(";", -1);
profile = parseProfile(profileData);