mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Added detection of McRegion-format worlds for snapshot detection.
This commit is contained in:
parent
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user