diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index 5010254..8100c01 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -116,8 +116,8 @@ public class SubserverSystem { if(eventFightID == -1) return new Bauserver(serverName, player1, port, process, () -> { try { - new ProcessBuilder("rm", "-r", ARENA_PATH + finalMapName).start(); - } catch (IOException e) { + new ProcessBuilder("rm", "-r", ARENA_PATH + finalMapName).start().waitFor(); + } catch (IOException | InterruptedException e) { throw new SecurityException("Could not clean up folder", e); } }); @@ -127,8 +127,8 @@ public class SubserverSystem { return; try { - new ProcessBuilder("rm", "-r", ARENA_PATH + finalMapName).start(); - } catch (IOException e) { + new ProcessBuilder("rm", "-r", ARENA_PATH + finalMapName).start().waitFor(); + } catch (IOException | InterruptedException e) { throw new SecurityException("Could not clean up folder", e); } });