世界管理新增删除世界功能 (#4263)

Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: Glavo <zjx001202@gmail.com>
This commit is contained in:
Wulian233
2025-09-15 23:06:30 +08:00
committed by GitHub
parent f594abc37d
commit 7c024473d6
13 changed files with 68 additions and 13 deletions

View File

@@ -275,6 +275,13 @@ public final class World {
}
}
public void delete() throws IOException {
if (isLocked()) {
throw new WorldLockedException("The world " + getFile() + " has been locked");
}
FileUtils.deleteDirectory(file);
}
public CompoundTag readLevelDat() throws IOException {
if (!Files.isDirectory(file))
throw new IOException("Not a valid world directory");