Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Added detection of McRegion-format worlds for snapshot detection.
Dieser Commit ist enthalten in:
Ursprung
96e75a4cae
Commit
1d68fdd11c
@ -75,4 +75,11 @@ public abstract class ChunkStore {
|
||||
public void close() throws IOException {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the chunk store is of this type.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract boolean isValid();
|
||||
}
|
||||
|
@ -62,4 +62,9 @@ public class FileLegacyChunkStore extends LegacyChunkStore {
|
||||
throw new MissingChunkException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true; // Yeah, oh well
|
||||
}
|
||||
}
|
||||
|
@ -54,4 +54,9 @@ public class FileMcRegionChunkStore extends McRegionChunkStore {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return new File(path, "region").isDirectory();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -164,4 +164,9 @@ public class TrueZipLegacyChunkStore extends LegacyChunkStore {
|
||||
public void close() throws IOException {
|
||||
zip.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true; // Yeah, oh well
|
||||
}
|
||||
}
|
||||
|
@ -161,4 +161,9 @@ public class ZippedAlphaChunkStore extends LegacyChunkStore {
|
||||
public void close() throws IOException {
|
||||
zip.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true; // Yeah, oh well
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,13 @@ public class Snapshot {
|
||||
throw new DataException("TrueZIP is required for .tar support");
|
||||
}
|
||||
} else {
|
||||
return new FileLegacyChunkStore(file);
|
||||
ChunkStore chunkStore = new FileMcRegionChunkStore(file);
|
||||
|
||||
if (!chunkStore.isValid()) {
|
||||
return new FileLegacyChunkStore(file);
|
||||
}
|
||||
|
||||
return chunkStore;
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren