Improve zip file recognition.

Look for world/level.dat because some zip file generators do not include
entries for directories by themselves.
This commit is contained in:
Rusty Burchfield 2011-12-25 14:15:33 -08:00 committed by zml2008
parent 05125c496e
commit 72b2c90c19

View File

@ -132,7 +132,8 @@ public class Snapshot implements Comparable<Snapshot> {
try {
if (file.getName().toLowerCase().endsWith(".zip")) {
ZipFile entry = new ZipFile(file);
return entry.getEntry(worldname) != null;
return (entry.getEntry(worldname) != null
|| entry.getEntry(worldname + "/level.dat") != null);
} else if (file.getName().toLowerCase().endsWith(".tar.bz2")
|| file.getName().toLowerCase().endsWith(".tar.gz")
|| file.getName().toLowerCase().endsWith(".tar")) {