diff --git a/src/de/steamwar/bungeecore/Subserver.java b/src/de/steamwar/bungeecore/Subserver.java index 377b91f..523550d 100644 --- a/src/de/steamwar/bungeecore/Subserver.java +++ b/src/de/steamwar/bungeecore/Subserver.java @@ -12,6 +12,7 @@ import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; @@ -27,6 +28,12 @@ public class Subserver implements Runnable { } return null; } + public static Subserver getSubserver(ServerInfo server){ + for(Subserver s : serverList) + if(s.server == server) + return s; + return null; + } public static List getServerList(){ return serverList; } @@ -81,7 +88,8 @@ public class Subserver implements Runnable { public void stop(){ writer.println("stop"); try { - p.waitFor(); + if(!p.waitFor(1, TimeUnit.MINUTES)) + p.destroy(); }catch(InterruptedException e){ logger.log(Level.SEVERE, "Subserver stop interrupted!", e); Thread.currentThread().interrupt();