Fix #463
This commit is contained in:
@@ -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");
|
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())) {
|
try (Zipper zip = new Zipper(output.toPath())) {
|
||||||
zip.putDirectory(repository.getRunDirectory(version).toPath(), "minecraft", path -> {
|
zip.putDirectory(repository.getRunDirectory(version).toPath(), "minecraft", path -> {
|
||||||
|
if (path.isEmpty())
|
||||||
|
return true;
|
||||||
for (String s : blackList)
|
for (String s : blackList)
|
||||||
if (path.equals(s))
|
if (path.equals(s))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public final class HMCLModpackManager {
|
|||||||
public static final List<String> MODPACK_BLACK_LIST = Lang.immutableListOf(
|
public static final List<String> MODPACK_BLACK_LIST = Lang.immutableListOf(
|
||||||
"usernamecache.json", "usercache.json", // Minecraft
|
"usernamecache.json", "usercache.json", // Minecraft
|
||||||
"launcher_profiles.json", "launcher.pack.lzma", // Minecraft Launcher
|
"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
|
"manifest.json", "minecraftinstance.json", ".curseclient", // Curse
|
||||||
"minetweaker.log", // Mods
|
"minetweaker.log", // Mods
|
||||||
"jars", "logs", "versions", "assets", "libraries", "crash-reports", "NVIDIA", "AMD", "screenshots", "natives", "native", "$native", "server-resource-packs", // Minecraft
|
"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;
|
return FileVisitResult.SKIP_SUBTREE;
|
||||||
}
|
}
|
||||||
String relativePath = source.relativize(file).normalize().toString();
|
String relativePath = source.relativize(file).normalize().toString();
|
||||||
if (filter != null && !filter.test(relativePath)) {
|
if (filter != null && !filter.test(relativePath.replace('\\', '/'))) {
|
||||||
return FileVisitResult.SKIP_SUBTREE;
|
return FileVisitResult.SKIP_SUBTREE;
|
||||||
}
|
}
|
||||||
Files.copy(file, root.resolve(relativePath));
|
Files.copy(file, root.resolve(relativePath));
|
||||||
@@ -86,7 +86,7 @@ public final class Zipper implements Closeable {
|
|||||||
@Override
|
@Override
|
||||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
|
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
|
||||||
String relativePath = source.relativize(dir).normalize().toString();
|
String relativePath = source.relativize(dir).normalize().toString();
|
||||||
if (filter != null && !filter.test(relativePath)) {
|
if (filter != null && !filter.test(relativePath.replace('\\', '/'))) {
|
||||||
return FileVisitResult.SKIP_SUBTREE;
|
return FileVisitResult.SKIP_SUBTREE;
|
||||||
}
|
}
|
||||||
Path path = root.resolve(relativePath);
|
Path path = root.resolve(relativePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user