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:
@ -3,7 +3,10 @@ package net.knarcraft.minecraftserverlauncher.server;
|
||||
import net.knarcraft.minecraftserverlauncher.Main;
|
||||
import net.knarcraft.minecraftserverlauncher.utility.CommonFunctions;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -122,8 +125,8 @@ public class ServerVersionContainer {
|
||||
if (!new File(versionFile).exists()) {
|
||||
return;
|
||||
}
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(versionFile)))) {
|
||||
String currentData = CommonFunctions.readBufferedReader(reader);
|
||||
try {
|
||||
String currentData = CommonFunctions.readFile(versionFile);
|
||||
for (String line : currentData.split("\n")) {
|
||||
parseSaveLine(line);
|
||||
}
|
||||
@ -178,9 +181,9 @@ public class ServerVersionContainer {
|
||||
* Reads versions from a text string and updates the version map
|
||||
*
|
||||
* @param targetMap <p>The map to update</p>
|
||||
* @param data <p>The data string to parse</p>
|
||||
* @param data <p>The data string to parse</p>
|
||||
*/
|
||||
private void parseVersionsToMap(Map<String,String> targetMap, String data) {
|
||||
private void parseVersionsToMap(Map<String, String> targetMap, String data) {
|
||||
String[] versions = data.split(",");
|
||||
for (String version : versions) {
|
||||
String[] versionData = version.split("!");
|
||||
|
Reference in New Issue
Block a user