mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-09-25 13:52:48 +02: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.io.IOException;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
@ -42,9 +43,19 @@ public class BukkitWorld implements ServerWorld {
|
|||||||
|
|
||||||
public BukkitWorld(World delegate) {
|
public BukkitWorld(World delegate) {
|
||||||
this.delegate = new WeakReference<>(delegate);
|
this.delegate = new WeakReference<>(delegate);
|
||||||
this.saveFolder = delegate.getWorldFolder().toPath()
|
Dimension dimension = getDimension();
|
||||||
.resolve(getDimension().getDimensionSubPath())
|
Path saveFolder = delegate.getWorldFolder().toPath()
|
||||||
|
.resolve(dimension.getDimensionSubPath())
|
||||||
.toAbsolutePath().normalize();
|
.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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user