Improves checking for whether a server should be delayed before starting
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good

This commit is contained in:
2021-08-24 16:08:02 +02:00
parent 9532683301
commit 5e24d5daa8
2 changed files with 10 additions and 4 deletions

View File

@ -117,9 +117,11 @@ public class ServerHandler {
public static void startServers() {
ServerLauncherController controller = Main.getController();
gui.setStatus("Starting servers");
int serverNum = 0;
Server previouslyStartedServer = null;
for (Collection collection : controller.getCurrentProfile().getCollections()) {
if (!collection.getServer().runServer(serverNum++ == 0)) {
Server server = collection.getServer();
if (!server.runServer(previouslyStartedServer == null || previouslyStartedServer.isProxy())) {
gui.showError("An error occurred. Start aborted. Please check relevant log files.");
try {
stop();
@ -129,6 +131,9 @@ public class ServerHandler {
gui.updateGUIElementsWhenServersStartOrStop(false);
return;
}
if (server.isEnabled()) {
previouslyStartedServer = server;
}
}
}