mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 02:26:00 +01:00
Never overwrite existing world-ids
This commit is contained in:
parent
dafabac5bb
commit
c289fd8c13
@ -105,20 +105,10 @@ public synchronized String getWorldId(Path worldFolder) throws IOException {
|
||||
// now we can be sure it wasn't loaded yet .. load
|
||||
|
||||
Path idFile = worldFolder.resolve("bluemap.id");
|
||||
id = this.serverInterface.getWorld(worldFolder)
|
||||
.flatMap(ServerWorld::getId)
|
||||
.orElse(null);
|
||||
|
||||
if (id != null) {
|
||||
// create/update id-file in worldfolder
|
||||
Files.writeString(idFile, id, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
|
||||
|
||||
worldIds.put(worldFolder, id);
|
||||
return id;
|
||||
}
|
||||
|
||||
if (!Files.exists(idFile)) {
|
||||
id = UUID.randomUUID().toString();
|
||||
id = this.serverInterface.getWorld(worldFolder)
|
||||
.flatMap(ServerWorld::getId)
|
||||
.orElse(UUID.randomUUID().toString());
|
||||
Files.writeString(idFile, id, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
|
||||
|
||||
worldIds.put(worldFolder, id);
|
||||
|
Loading…
Reference in New Issue
Block a user