From 27d260a8d2ffda38732c4182e231a66521a71187 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Mon, 19 Oct 2026 10:14:10 +0200 Subject: [PATCH] Delete CRIU checkpoint on /bau delete /bau delete only removed the world folder. The checkpoint of the build server stayed in place, so the next start restored the old JVM state against a freshly copied world (superflat world, plugins inactive). Extract ServerStarter#checkpointDir and delete the checkpoint together with the world. Fixes #438 --- .../src/de/steamwar/velocitycore/ServerStarter.java | 6 +++++- .../src/de/steamwar/velocitycore/commands/BauCommand.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java b/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java index a4dc58fc..eab63787 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java +++ b/VelocityCore/src/de/steamwar/velocitycore/ServerStarter.java @@ -303,7 +303,7 @@ public class ServerStarter { worldSetup.run(); arguments.put("logPath", worldName); - File checkpointDir = new File("/tmp/" + System.getProperty("user.name") + ".checkpoints/" + directory.getName() + "/" + worldName); + File checkpointDir = checkpointDir(directory, worldName); if (checkpoint) { arguments.put("checkpoint", checkpointDir.getPath()); } @@ -326,6 +326,10 @@ public class ServerStarter { }).schedule(); } + public static File checkpointDir(File serverDirectory, String worldName) { + return new File("/tmp/" + System.getProperty("user.name") + ".checkpoints/" + serverDirectory.getName() + "/" + worldName); + } + private void regularStart(String serverName, int port) { postStart(constructor.construct(serverName, port, node.startServer( version, directory, worldDir, worldName, port, arguments.entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).toArray(String[]::new) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java index 048e3125..d97e1e46 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java @@ -261,6 +261,7 @@ public class BauCommand extends SWCommand { } SubserverSystem.deleteFolder(VelocityCore.local, world); + SubserverSystem.deleteFolder(VelocityCore.local, ServerStarter.checkpointDir(version.getServerDirectory("Bau"), String.valueOf(sender.user().getId())).getPath()); sender.system("BAU_DELETE_DELETED"); }).schedule();