mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2025-01-12 12:25:03 +08:00
Added detection of McRegion-format worlds for snapshot detection.
This commit is contained in:
parent
96e75a4cae
commit
1d68fdd11c
@ -75,4 +75,11 @@ public Chunk getChunk(Vector2D pos)
|
||||
public void close() throws IOException {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the chunk store is of this type.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract boolean isValid();
|
||||
}
|
||||
|
@ -62,4 +62,9 @@ protected InputStream getInputStream(String f1, String f2, String name)
|
||||
throw new MissingChunkException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true; // Yeah, oh well
|
||||
}
|
||||
}
|
||||
|
@ -54,4 +54,9 @@ protected InputStream getInputStream(String name) throws IOException,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return new File(path, "region").isDirectory();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -164,4 +164,9 @@ private ZipEntry getEntry(String file) {
|
||||
public void close() throws IOException {
|
||||
zip.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true; // Yeah, oh well
|
||||
}
|
||||
}
|
||||
|
@ -161,4 +161,9 @@ private ZipEntry getEntry(String file) {
|
||||
public void close() throws IOException {
|
||||
zip.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true; // Yeah, oh well
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,13 @@ public ChunkStore getChunkStore() throws IOException, DataException {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user