mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-03-07 17:36:52 +08:00
Fix #463
This commit is contained in:
parent
92520e46a3
commit
8e1e13058b
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user