Optimized the case when worlds were not in the root directory of a zip.

This commit is contained in:
sk89q 2011-03-10 00:26:01 -08:00
parent 7df2ae4e11
commit 8017a346cb
4 changed files with 12 additions and 8 deletions

View File

@ -119,8 +119,9 @@ protected InputStream getInputStream(String f1, String f2, String name)
// Whoo, found level.dat!
if (pattern.matcher(testEntry.getName()).matches()) {
file = testEntry.getName().replaceAll("level\\.dat$", "")
+ file;
folder = testEntry.getName().replaceAll("level\\.dat$", "");
folder = folder.substring(0, folder.length() - 1);
file = folder + file;
break;
}
}

View File

@ -116,8 +116,9 @@ protected InputStream getInputStream(String name)
// Whoo, found level.dat!
if (pattern.matcher(testEntry.getName()).matches()) {
file = testEntry.getName().replaceAll("level\\.dat$", "")
+ file;
folder = testEntry.getName().replaceAll("level\\.dat$", "");
folder = folder.substring(0, folder.length() - 1);
file = folder + file;
break;
}
}

View File

@ -116,8 +116,9 @@ protected InputStream getInputStream(String f1, String f2, String name)
// Whoo, found level.dat!
if (pattern.matcher(testEntry.getName()).matches()) {
file = testEntry.getName().replaceAll("level\\.dat$", "")
+ file;
folder = testEntry.getName().replaceAll("level\\.dat$", "");
folder = folder.substring(0, folder.length() - 1);
file = folder + file;
break;
}
}

View File

@ -113,8 +113,9 @@ protected InputStream getInputStream(String name)
// Whoo, found level.dat!
if (pattern.matcher(testEntry.getName()).matches()) {
file = testEntry.getName().replaceAll("level\\.dat$", "")
+ file;
folder = testEntry.getName().replaceAll("level\\.dat$", "");
folder = folder.substring(0, folder.length() - 1);
file = folder + file;
break;
}
}