diff --git a/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractModLocator.java b/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractModLocator.java index 96e8f3eb66..4f301ecc2c 100644 --- a/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractModLocator.java +++ b/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractModLocator.java @@ -31,6 +31,11 @@ public abstract class AbstractModLocator implements IModLocator protected static final String MANIFEST = "META-INF/MANIFEST.MF"; protected Optional createMod(Path... path) { + return this.createMod(getDefaultJarModType(), path); + } + + // FORGE: Backporting artifact, the defaultType must be the first parameter since path is varargs + protected Optional createMod(String defaultType, Path... path) { var mjm = new ModJarMetadata(); var sj = SecureJar.from( Manifest::new, @@ -42,7 +47,7 @@ public abstract class AbstractModLocator implements IModLocator IModFile mod; var type = sj.getManifest().getMainAttributes().getValue(ModFile.TYPE); if (type == null) { - type = getDefaultJarModType(); + type = defaultType; } if (sj.findFile(MODS_TOML).isPresent()) { LOGGER.debug(LogMarkers.SCAN, "Found {} mod of type {}: {}", MODS_TOML, type, path); diff --git a/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/JarInJarDependencyLocator.java b/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/JarInJarDependencyLocator.java index 3b81f03715..0409befe0b 100644 --- a/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/JarInJarDependencyLocator.java +++ b/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/JarInJarDependencyLocator.java @@ -81,7 +81,14 @@ public class JarInJarDependencyLocator extends AbstractJarFileDependencyLocator final Map outerFsArgs = ImmutableMap.of("packagePath", pathInModFile); final FileSystem zipFS = FileSystems.newFileSystem(filePathUri, outerFsArgs); final Path pathInFS = zipFS.getPath("/"); - return createMod(pathInFS); + final IModFile.Type parentType = file.getType(); + final String modType; + if (parentType == IModFile.Type.LIBRARY || parentType == IModFile.Type.LANGPROVIDER) { + modType = IModFile.Type.LIBRARY.name(); + } else { + modType = IModFile.Type.GAMELIBRARY.name(); + } + return createMod(modType, pathInFS); } catch (Exception e) {