mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
@@ -53,7 +53,7 @@ public class JarNester {
|
||||
return;
|
||||
}
|
||||
|
||||
Preconditions.checkArgument(FabricModJsonFactory.isModJar(modJar, platform), "Cannot nest jars into none mod jar " + modJar.getName());
|
||||
Preconditions.checkArgument(FabricModJsonFactory.isNestableModJar(modJar, platform), "Cannot nest jars into none mod jar " + modJar.getName());
|
||||
|
||||
try {
|
||||
ZipUtils.add(modJar.toPath(), jars.stream().map(file -> {
|
||||
@@ -78,7 +78,7 @@ public class JarNester {
|
||||
|
||||
for (File file : jars) {
|
||||
String nestedJarPath = "META-INF/jars/" + file.getName();
|
||||
Preconditions.checkArgument(FabricModJsonFactory.isModJar(file, platform), "Cannot nest none mod jar: " + file.getName());
|
||||
Preconditions.checkArgument(FabricModJsonFactory.isNestableModJar(file, platform), "Cannot nest none mod jar: " + file.getName());
|
||||
|
||||
for (JsonElement nestedJar : nestedJars) {
|
||||
JsonObject jsonObject = nestedJar.getAsJsonObject();
|
||||
@@ -115,7 +115,7 @@ public class JarNester {
|
||||
|
||||
for (File file : jars) {
|
||||
String nestedJarPath = "META-INF/jars/" + file.getName();
|
||||
Preconditions.checkArgument(FabricModJsonFactory.isModJar(file, platform), "Cannot nest none mod jar: " + file.getName());
|
||||
Preconditions.checkArgument(FabricModJsonFactory.isNestableModJar(file, platform), "Cannot nest none mod jar: " + file.getName());
|
||||
|
||||
for (JsonElement nestedJar : nestedJars) {
|
||||
String nestedJarString = nestedJar.getAsString();
|
||||
|
||||
@@ -175,6 +175,16 @@ public final class FabricModJsonFactory {
|
||||
return ZipUtils.contains(input, FABRIC_MOD_JSON);
|
||||
}
|
||||
|
||||
public static boolean isNestableModJar(File file, ModPlatform platform) {
|
||||
return isNestableModJar(file.toPath(), platform);
|
||||
}
|
||||
|
||||
public static boolean isNestableModJar(Path input, ModPlatform platform) {
|
||||
// Forge don't care if the main jar is mod jar.
|
||||
if (platform == ModPlatform.FORGE) return true;
|
||||
return isModJar(input, platform);
|
||||
}
|
||||
|
||||
public static boolean containsMod(FileSystemUtil.Delegate fs, ModPlatform platform) {
|
||||
if (Files.exists(fs.getPath("architectury.common.marker"))) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user