mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Delete forge mods' jarjar metadata (#159)
* Delete forge mods' jarjar metadata * Update ZipUtils.java * Update src/main/java/net/fabricmc/loom/util/ZipUtils.java Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com> --------- Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
This commit is contained in:
@@ -121,6 +121,12 @@ public class ModProcessor {
|
||||
}
|
||||
|
||||
private void stripNestedJars(Path path) {
|
||||
try {
|
||||
ZipUtils.deleteIfExists(path, "META-INF/jarjar/metadata.json");
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException("Failed to strip nested jars from %s".formatted(path), e);
|
||||
}
|
||||
|
||||
if (!ZipUtils.contains(path, "fabric.mod.json")) {
|
||||
if (ZipUtils.contains(path, "quilt.mod.json")) {
|
||||
// Strip out all contained jar info as we dont want loader to try and load the jars contained in dev.
|
||||
|
||||
@@ -184,6 +184,12 @@ public class ZipUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void deleteIfExists(Path zip, String path) throws IOException {
|
||||
try (FileSystemUtil.Delegate fs = FileSystemUtil.getJarFileSystem(zip, false)) {
|
||||
Files.deleteIfExists(fs.getPath(path));
|
||||
}
|
||||
}
|
||||
|
||||
public static int transformString(Path zip, Collection<Pair<String, UnsafeUnaryOperator<String>>> transforms) throws IOException {
|
||||
return transformString(zip, transforms.stream());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user