Fixes some messages and some jar downloads
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
This commit is contained in:
parent
26cc5370e2
commit
b144bbb903
@ -10,7 +10,7 @@ public interface GUI {
|
|||||||
*
|
*
|
||||||
* @param message <p>The message contents</p>
|
* @param message <p>The message contents</p>
|
||||||
*/
|
*/
|
||||||
void printMessageToGUI(String message);
|
void setStatus(String message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays an error to the user as an independent box
|
* Displays an error to the user as an independent box
|
||||||
|
@ -90,11 +90,7 @@ public class ServerLauncherGUI extends MessageHandler implements ActionListener,
|
|||||||
return this.serversPane;
|
return this.serversPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Sets the text of the status label.
|
|
||||||
*
|
|
||||||
* @param text The new text
|
|
||||||
*/
|
|
||||||
public void setStatus(String text) {
|
public void setStatus(String text) {
|
||||||
this.lblStatuslabel.setText(text);
|
this.lblStatuslabel.setText(text);
|
||||||
try (PrintWriter file = new PrintWriter(new FileWriter(Main.getApplicationWorkDirectory() + File.separator + "latestrun.log", true))) {
|
try (PrintWriter file = new PrintWriter(new FileWriter(Main.getApplicationWorkDirectory() + File.separator + "latestrun.log", true))) {
|
||||||
@ -803,9 +799,4 @@ public class ServerLauncherGUI extends MessageHandler implements ActionListener,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void printMessageToGUI(String message) {
|
|
||||||
setStatus(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,11 @@ public class JarDownloader {
|
|||||||
throw new FileNotFoundException("Unable to create jars folder");
|
throw new FileNotFoundException("Unable to create jars folder");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
gui.setStatus("Downloading all jars...");
|
||||||
downloadAll();
|
downloadAll();
|
||||||
gui.printMessageToGUI("Finished downloading jars");
|
gui.setStatus("Finished downloading jars");
|
||||||
} catch (FileNotFoundException | ConfigurationException e) {
|
} catch (FileNotFoundException | ConfigurationException e) {
|
||||||
|
gui.setStatus(e.getMessage());
|
||||||
throw new FileNotFoundException("One or more downloads failed: " + e.getMessage());
|
throw new FileNotFoundException("One or more downloads failed: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,6 +60,7 @@ public class JarDownloader {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (String version : type.getVersions()) {
|
for (String version : type.getVersions()) {
|
||||||
|
gui.setStatus("Downloading " + type.getName() + version + "...");
|
||||||
boolean success = type.downloadJar(jarDirectory, version);
|
boolean success = type.downloadJar(jarDirectory, version);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
throw new FileNotFoundException("Unable to download the jar file for " + type.getName() + version);
|
throw new FileNotFoundException("Unable to download the jar file for " + type.getName() + version);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
SpongeVanilla;1.12.2,1.11.2,1.10.2,1.8.9;https://dl-api.spongepowered.org/v1/org.spongepowered/spongevanilla/downloads?type=stable&minecraft=;"version":";",;https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/;/spongevanilla-
|
SpongeVanilla;1.12.2,1.11.2,1.10.2,1.8.9;https://dl-api.spongepowered.org/v1/org.spongepowered/spongevanilla/downloads?type=stable&minecraft=;"version":";",;https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/;/spongevanilla-
|
||||||
Spigot;1.16.1,1.15.2,1.14.4,1.13.2,1.12.2,1.11.2,1.10.2,1.9.4,1.9.4,1.8.8,1.7.10,1.6.4,1.5.2,1.4.7;https://static.knarcraft.net/archive/downloads/minecraftserverjars/Spigot/;Spigot
|
Spigot;1.16.1,1.15.2,1.14.4,1.13.2,1.12.2,1.11.2,1.10.2,1.9.4,1.9.4,1.8.8,1.7.10,1.6.4-R2.1,1.5.2-R1.1,1.4.7-R1.1;https://static.knarcraft.net/archive/downloads/minecraftserverjars/Spigot/;spigot-
|
||||||
MCPCplus;1.6.4,1.6.2,1.5.2,1.4.7;https://static.knarcraft.net/archive/downloads/minecraftserverjars/MCPC+/;mcpcplus
|
MCPCplus;1.6.4,1.6.2,1.5.2,1.4.7;https://static.knarcraft.net/archive/downloads/minecraftserverjars/MCPC+/;mcpcplus
|
||||||
Craftbukkit;1.13.2,1.12.2,1.11.2,1.10.2,1.9.4,1.8.8,1.7.10-R0.1,1.6.4-R2.0,1.5.2-R1.0,1.4.6-R0.3,1.3.2-R3.0,1.2.5-R2.0,1.1-R6,1.0.1-R1;https://static.knarcraft.net/archive/downloads/minecraftserverjars/Bukkit/;craftbukkit-
|
Craftbukkit;1.13.2,1.12.2,1.11.2,1.10.2,1.9.4,1.8.8,1.7.10-R0.1,1.6.4-R2.0,1.5.2-R1.0,1.4.6-R0.3,1.3.2-R3.0,1.2.5-R2.0,1.1-R6,1.0.1-R1;https://static.knarcraft.net/archive/downloads/minecraftserverjars/Bukkit/;craftbukkit-
|
||||||
Paper;1.16.1,1.15.2,1.14.4,1.13.2,1.12.2,1.11.2,1.10.2,1.9.4,1.8.8;https://static.knarcraft.net/archive/downloads/minecraftserverjars/Paper/;Paper-
|
Paper;1.16.1,1.15.2,1.14.4,1.13.2,1.12.2,1.11.2,1.10.2,1.9.4,1.8.8;https://static.knarcraft.net/archive/downloads/minecraftserverjars/Paper/;Paper-
|
||||||
|
Can't render this file because it contains an unexpected character in line 1 and column 151.
|
@ -10,7 +10,7 @@ public class FakeGUI extends MessageHandler implements GUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void printMessageToGUI(String message) {
|
public void setStatus(String message) {
|
||||||
System.out.println(message);
|
System.out.println(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user