Makes some improvements
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good

Saves the downloaded BuildTools version to the server version container
Adds a check to see whether the BuildTools file exists
Adds a helper function for reading local files
This commit is contained in:
2021-08-02 16:09:22 +02:00
parent 51ceac69da
commit 043f2045e6
12 changed files with 77 additions and 31 deletions

View File

@ -191,7 +191,7 @@ public class Controller {
//Loads data regarding this controller
String currentProfile = null;
if (new File(mainFile).exists()) {
String controllerData = CommonFunctions.readBufferedReader(new BufferedReader(new InputStreamReader(new FileInputStream(mainFile))));
String controllerData = CommonFunctions.readFile(mainFile);
currentProfile = this.fromString(controllerData);
} else {
this.serverLauncherGUI = new ServerLauncherGUI();
@ -274,7 +274,7 @@ public class Controller {
try {
CommonFunctions.createAllFolders();
PrintWriter mFile = new PrintWriter(mainFile);
mFile.println(this.toString());
mFile.println(this);
mFile.close();
PrintWriter pFile = new PrintWriter(profilesFile);
for (Profile profile : profileList) {