Closes version file

This commit is contained in:
Kristian Knarvik 2018-12-18 00:58:42 +01:00
parent 998b901687
commit cade97adbe

View File

@ -198,6 +198,7 @@ public class Main {
String oldType = file.nextLine();
String oldVer = file.nextLine();
file.close();
String data = readFile(updateURL);
JsonObject jsonObject = new JsonParser().parse(data).getAsJsonObject();
@ -239,6 +240,7 @@ public class Main {
if (new File (dir + "Minecraft-Server-Launcher.jar").renameTo(new File(dir + "Old.jar"))) {
if (new File(dir + "update.jar").renameTo(new File (dir + "Minecraft-Server-Launcher.jar"))) {
if (new File(dir + "Old.jar").delete()) {
JOptionPane.showMessageDialog(
null,
"Update finished. Please run the software again.",