From 9493b251a6fdddb338901430ba1b2355890ede22 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 20 Jan 2024 08:59:19 +0100 Subject: [PATCH] Fix failure callback order. --- src/de/steamwar/bungeecore/Subserver.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/Subserver.java b/src/de/steamwar/bungeecore/Subserver.java index 586524f..f7f4db7 100644 --- a/src/de/steamwar/bungeecore/Subserver.java +++ b/src/de/steamwar/bungeecore/Subserver.java @@ -170,17 +170,18 @@ public class Subserver { started = test.test(line); } - if(line == null){ - failureCallback.accept(new IOException(serverName + " did not start correctly!")); - started = false; - } + if(line == null) + throw new IOException(serverName + " did not start correctly!"); } } protected void register() { synchronized (serverList) { if(ProxyServer.getInstance().getServers().containsKey(serverName)) { - throw new SecurityException("Server already registered: " + serverName); + SecurityException e = new SecurityException("Server already registered: " + serverName); + stop(); + failureCallback.accept(e); + throw e; } ProxyServer.getInstance().getServers().put(serverName, server); @@ -212,7 +213,7 @@ public class Subserver { sendProgress(4); else if(line.contains("Preparing start region")) sendProgress(6); - return line.contains("Done ("); + return line.contains("Finished mapping loading"); }); }