This commit is contained in:
huanghongxun 2018-10-02 18:33:48 +08:00
parent 92520e46a3
commit 8e1e13058b
3 changed files with 5 additions and 3 deletions

View File

@ -61,6 +61,8 @@ public class HMCLModpackExportTask extends Task {
Logging.LOG.info("Compressing game files without some files in blacklist, including files or directories: usernamecache.json, asm, logs, backups, versions, assets, usercache.json, libraries, crash-reports, launcher_profiles.json, NVIDIA, TCNodeTracker");
try (Zipper zip = new Zipper(output.toPath())) {
zip.putDirectory(repository.getRunDirectory(version).toPath(), "minecraft", path -> {
if (path.isEmpty())
return true;
for (String s : blackList)
if (path.equals(s))
return false;

View File

@ -36,7 +36,7 @@ public final class HMCLModpackManager {
public static final List<String> MODPACK_BLACK_LIST = Lang.immutableListOf(
"usernamecache.json", "usercache.json", // Minecraft
"launcher_profiles.json", "launcher.pack.lzma", // Minecraft Launcher
"pack.json", "launcher.jar", "hmclmc.log", // HMCL
"pack.json", "launcher.jar", "hmclmc.log", "cache", // HMCL
"manifest.json", "minecraftinstance.json", ".curseclient", // Curse
"minetweaker.log", // Mods
"jars", "logs", "versions", "assets", "libraries", "crash-reports", "NVIDIA", "AMD", "screenshots", "natives", "native", "$native", "server-resource-packs", // Minecraft

View File

@ -76,7 +76,7 @@ public final class Zipper implements Closeable {
return FileVisitResult.SKIP_SUBTREE;
}
String relativePath = source.relativize(file).normalize().toString();
if (filter != null && !filter.test(relativePath)) {
if (filter != null && !filter.test(relativePath.replace('\\', '/'))) {
return FileVisitResult.SKIP_SUBTREE;
}
Files.copy(file, root.resolve(relativePath));
@ -86,7 +86,7 @@ public final class Zipper implements Closeable {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
String relativePath = source.relativize(dir).normalize().toString();
if (filter != null && !filter.test(relativePath)) {
if (filter != null && !filter.test(relativePath.replace('\\', '/'))) {
return FileVisitResult.SKIP_SUBTREE;
}
Path path = root.resolve(relativePath);