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.
This commit is contained in:
mja00 2024-08-12 06:27:15 -04:00
parent 4b761f97a3
commit 15c3f06938

View file

@ -31,9 +31,10 @@
- public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String directoryName) throws IOException, ContentValidationException {
- Path path = this.getLevelPath(directoryName);
- List<ForbiddenSymlinkInfo> list = this.worldDirValidator.validateDirectory(path, true);
+ public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String s, ResourceKey<LevelStem> dimensionType) throws IOException, ContentValidationException { // CraftBukkit
+ Path path = this.getLevelPath(s);
List<ForbiddenSymlinkInfo> list = this.worldDirValidator.validateDirectory(path, true);
+ List<ForbiddenSymlinkInfo> 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);