Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename mods.toml to neoforge.mods.toml #100

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion loader/src/main/java/net/neoforged/fml/ModLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.neoforged.fml.loading.FMLLoader;
import net.neoforged.fml.loading.ImmediateWindowHandler;
import net.neoforged.fml.loading.LoadingModList;
import net.neoforged.fml.loading.moddiscovery.AbstractModProvider;
import net.neoforged.fml.loading.moddiscovery.InvalidModIdentifier;
import net.neoforged.fml.loading.moddiscovery.ModFileInfo;
import net.neoforged.fml.loading.moddiscovery.ModInfo;
Expand Down Expand Up @@ -277,7 +278,7 @@ private List<ModContainer> buildMods(final IModFile modFile)

var missingClasses = new ArrayList<>(modIds);
missingClasses.removeAll(containerIds);
LOGGER.fatal(LOADING, "The following classes are missing, but are reported in the mods.toml: {}", missingClasses);
LOGGER.fatal(LOADING, "The following classes are missing, but are reported in the {}: {}", AbstractModProvider.MODS_TOML, missingClasses);

var missingMods = new ArrayList<>(containerIds);
missingMods.removeAll(modIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public abstract class AbstractModProvider implements IModProvider
{
private static final Logger LOGGER = LogUtils.getLogger();
protected static final String MODS_TOML = "META-INF/mods.toml";
marchermans marked this conversation as resolved.
Show resolved Hide resolved
public static final String MODS_TOML = "META-INF/neoforge.mods.toml";
protected static final String MANIFEST = "META-INF/MANIFEST.MF";

protected IModLocator.ModFileOrException createMod(Path... path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public List<IModLocator.ModFileOrException> scanMods() {
mjm.setModFile(mf);
mods.put(explodedMod, mf);
} else {
LOGGER.warn(LogMarkers.LOADING, "Failed to find exploded resource mods.toml in directory {}", explodedMod.paths().get(0).toString());
LOGGER.warn(LogMarkers.LOADING, "Failed to find exploded resource {} in directory {}", AbstractModProvider.MODS_TOML, explodedMod.paths().get(0).toString());
}
});
return mods.values().stream().map(mf->new IModLocator.ModFileOrException(mf, null)).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public static IModFileInfo readModList(final ModFile modFile, final ModFileFacto
public static IModFileInfo modsTomlParser(final IModFile imodFile) {
ModFile modFile = (ModFile) imodFile;
LOGGER.debug(LogMarkers.LOADING,"Considering mod file candidate {}", modFile.getFilePath());
final Path modsjson = modFile.findResource("META-INF", "mods.toml");
final Path modsjson = modFile.findResource(AbstractModProvider.MODS_TOML);
if (!Files.exists(modsjson)) {
LOGGER.warn(LogMarkers.LOADING, "Mod file {} is missing mods.toml file", modFile.getFilePath());
LOGGER.warn(LogMarkers.LOADING, "Mod file {} is missing {} file", modFile.getFilePath(), AbstractModProvider.MODS_TOML);
return null;
}

Expand Down Expand Up @@ -106,4 +106,4 @@ protected static Optional<List<String>> getAccessTransformers(IModFileInfo modFi
return Optional.of(List.of());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import cpw.mods.jarhandling.SecureJar;
import cpw.mods.niofs.union.UnionPathFilter;
import net.neoforged.fml.loading.FileUtils;
import net.neoforged.fml.loading.moddiscovery.AbstractModProvider;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down Expand Up @@ -119,7 +120,7 @@ protected UnionPathFilter getMcFilter(Path extra, List<Path> minecraft, Stream.B
}

protected String[] getExcludedPrefixes() {
return new String[]{ "net/neoforged/neoforge/", "META-INF/services/", "META-INF/coremods.json", "META-INF/mods.toml" };
return new String[]{ "net/neoforged/neoforge/", "META-INF/services/", "META-INF/coremods.json", AbstractModProvider.MODS_TOML};
}

private static String getRandomNumbers(int length) {
Expand Down
Loading