mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-20 23:31:21 +01:00
Fix issue with hybrids (arclight) sometimes reporting the wrong worldfolder
This commit is contained in:
parent
0f58b7409b
commit
701f6cb2dc
@ -31,6 +31,7 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@ -42,9 +43,19 @@ public class BukkitWorld implements ServerWorld {
|
||||
|
||||
public BukkitWorld(World delegate) {
|
||||
this.delegate = new WeakReference<>(delegate);
|
||||
this.saveFolder = delegate.getWorldFolder().toPath()
|
||||
.resolve(getDimension().getDimensionSubPath())
|
||||
Dimension dimension = getDimension();
|
||||
Path saveFolder = delegate.getWorldFolder().toPath()
|
||||
.resolve(dimension.getDimensionSubPath())
|
||||
.toAbsolutePath().normalize();
|
||||
|
||||
// fix for hybrids
|
||||
if (!Files.exists(saveFolder)) {
|
||||
Path direct = delegate.getWorldFolder().toPath();
|
||||
if (Files.exists(direct) && direct.endsWith(dimension.getDimensionSubPath()))
|
||||
saveFolder = direct;
|
||||
}
|
||||
|
||||
this.saveFolder = saveFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user