From 15c3f069387e9aeac4ff79c5e5d047733681c975 Mon Sep 17 00:00:00 2001 From: mja00 Date: Mon, 12 Aug 2024 06:27:15 -0400 Subject: [PATCH] Add skipping world symlink scan In worlds that are extremely large (greater than 1TB), it can take an insanely long time to walk the entire world for symlinks. This patch adds a system property to disable the symlink scan, which can be used to speed up world loading. --- .../world/level/storage/LevelStorageSource.java.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch b/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch index 90b7400290..e0a1e52b18 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch @@ -31,9 +31,10 @@ - public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String directoryName) throws IOException, ContentValidationException { - Path path = this.getLevelPath(directoryName); +- List list = this.worldDirValidator.validateDirectory(path, true); + public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String s, ResourceKey dimensionType) throws IOException, ContentValidationException { // CraftBukkit + Path path = this.getLevelPath(s); - List list = this.worldDirValidator.validateDirectory(path, true); ++ List list = Boolean.getBoolean("paper.disableWorldSymlinkValidation") ? List.of() : this.worldDirValidator.validateDirectory(path, true); // Paper - add skipping of symlinks scan if (!list.isEmpty()) { throw new ContentValidationException(path, list);