Files
Paper/paper-server/patches/features/0031-SW-Remove-Worldlock-and-Symlink-Check.patch

73 lines
3.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chaoscaot <chaos@chaoscaot.de>
Date: Wed, 25 Dec 2024 12:18:00 +0100
Subject: [PATCH] SW Remove Worldlock and Symlink Check
diff --git a/net/minecraft/world/level/storage/LevelStorageSource.java b/net/minecraft/world/level/storage/LevelStorageSource.java
index de43e54698125ce9f319d4889dd49f7029fe95e0..e21d744040bcf58b391f002f2dd1129e532ff1b6 100644
--- a/net/minecraft/world/level/storage/LevelStorageSource.java
+++ b/net/minecraft/world/level/storage/LevelStorageSource.java
@@ -343,7 +343,7 @@ public class LevelStorageSource {
public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String saveName, ResourceKey<LevelStem> dimensionType) throws IOException, ContentValidationException { // CraftBukkit
Path levelPath = this.getLevelPath(saveName);
- List<ForbiddenSymlinkInfo> list = Boolean.getBoolean("paper.disableWorldSymlinkValidation") ? List.of() : this.worldDirValidator.validateDirectory(levelPath, true); // Paper - add skipping of symlinks scan
+ List<ForbiddenSymlinkInfo> list = List.of(); // Paper - add skipping of symlinks scan
if (!list.isEmpty()) {
throw new ContentValidationException(levelPath, list);
} else {
@@ -420,7 +420,6 @@ public class LevelStorageSource {
}
public class LevelStorageAccess implements AutoCloseable {
- final DirectoryLock lock;
public final LevelStorageSource.LevelDirectory levelDirectory;
private final String levelId;
private final Map<LevelResource, Path> resources = Maps.newHashMap();
@@ -432,7 +431,6 @@ public class LevelStorageSource {
// CraftBukkit end
this.levelId = levelId;
this.levelDirectory = new LevelStorageSource.LevelDirectory(levelDir);
- this.lock = DirectoryLock.create(levelDir);
}
public long estimateDiskSpace() {
@@ -476,9 +474,7 @@ public class LevelStorageSource {
}
private void checkLock() {
- if (!this.lock.isValid()) {
- throw new IllegalStateException("Lock is no longer valid");
- }
+ //nope
}
public PlayerDataStorage createPlayerStorage() {
@@ -532,7 +528,7 @@ public class LevelStorageSource {
}
public Optional<Path> getIconFile() {
- return !this.lock.isValid() ? Optional.empty() : Optional.of(this.levelDirectory.iconFile());
+ return Optional.of(this.levelDirectory.iconFile());
}
public void deleteLevel() throws IOException {
@@ -561,7 +557,6 @@ public class LevelStorageSource {
throw exception;
} else {
if (dir.equals(LevelStorageAccess.this.levelDirectory.path())) {
- LevelStorageAccess.this.lock.close();
Files.deleteIfExists(path);
}
@@ -645,7 +640,7 @@ public class LevelStorageSource {
@Override
public void close() throws IOException {
- this.lock.close();
+ //ignored
}
public boolean restoreLevelDataFromOld() {