Fix ServerStarter.tempWorld

This commit is contained in:
2026-06-20 17:42:16 +02:00
parent 013d18614f
commit 0eef22aab0
@@ -201,7 +201,10 @@ public class ServerStarter {
private void tempWorld(String template) { private void tempWorld(String template) {
worldDir = TEMP_WORLD_PATH; worldDir = TEMP_WORLD_PATH;
worldSetup = () -> copyWorld(node, template, new File(worldDir, worldName).getPath()); worldSetup = () -> {
mkdirWorldDir(node, worldDir);
copyWorld(node, template, new File(worldDir, worldName).getPath());
};
worldCleanup = () -> SubserverSystem.deleteFolder(node, new File(worldDir, worldName).getPath()); worldCleanup = () -> SubserverSystem.deleteFolder(node, new File(worldDir, worldName).getPath());
} }
@@ -354,6 +357,10 @@ public class ServerStarter {
return serverName.replace(' ', '_').replace("[", "").replace("]", "").replace(".", ""); return serverName.replace(' ', '_').replace("[", "").replace("]", "").replace(".", "");
} }
public static void mkdirWorldDir(Node node, String targetDir) {
node.execute("mkdir", "p", targetDir);
}
public static void copyWorld(Node node, String template, String target) { public static void copyWorld(Node node, String template, String target) {
node.execute("cp", "-r", template, target); node.execute("cp", "-r", template, target);
} }