73 lines
3.2 KiB
Diff
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 8104f71c30c1fa46c83acdf0b2e58483df9d89cc..fe0a8254a362618f189c6db8bf86354cace4d310 100644
|
|
--- a/net/minecraft/world/level/storage/LevelStorageSource.java
|
|
+++ b/net/minecraft/world/level/storage/LevelStorageSource.java
|
|
@@ -344,7 +344,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 {
|
|
@@ -421,7 +421,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();
|
|
@@ -433,7 +432,6 @@ public class LevelStorageSource {
|
|
// CraftBukkit end
|
|
this.levelId = levelId;
|
|
this.levelDirectory = new LevelStorageSource.LevelDirectory(levelDir);
|
|
- this.lock = DirectoryLock.create(levelDir);
|
|
}
|
|
|
|
public long estimateDiskSpace() {
|
|
@@ -477,9 +475,7 @@ public class LevelStorageSource {
|
|
}
|
|
|
|
private void checkLock() {
|
|
- if (!this.lock.isValid()) {
|
|
- throw new IllegalStateException("Lock is no longer valid");
|
|
- }
|
|
+ //nope
|
|
}
|
|
|
|
public PlayerDataStorage createPlayerStorage() {
|
|
@@ -533,7 +529,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 {
|
|
@@ -562,7 +558,6 @@ public class LevelStorageSource {
|
|
throw exception;
|
|
} else {
|
|
if (dir.equals(LevelStorageAccess.this.levelDirectory.path())) {
|
|
- LevelStorageAccess.this.lock.close();
|
|
Files.deleteIfExists(path);
|
|
}
|
|
|
|
@@ -646,7 +641,7 @@ public class LevelStorageSource {
|
|
|
|
@Override
|
|
public void close() throws IOException {
|
|
- this.lock.close();
|
|
+ //ignored
|
|
}
|
|
|
|
public boolean restoreLevelDataFromOld() {
|