Class JarModsDotTomlModFileReader
java.lang.Object
net.neoforged.fml.loading.moddiscovery.readers.JarModsDotTomlModFileReader
- All Implemented Interfaces:
IModFileReader,IOrderedProvider
Responsible for handling mod files that are explicitly marked as mods or libraries via metadata files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerstatic final Stringstatic final StringFields inherited from interface net.neoforged.neoforgespi.locating.IOrderedProvider
DEFAULT_PRIORITY, HIGHEST_SYSTEM_PRIORITY, LOWEST_SYSTEM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IModFilecreateModFile(JarContents contents, ModFileDiscoveryAttributes discoveryAttributes) private static IModFile.TypegetModType(JarContents jar) static IModFileInfomanifestParser(IModFile mod) @Nullable IModFileread(JarContents jar, ModFileDiscoveryAttributes discoveryAttributes) Provides a mod from the givenjar.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforgespi.locating.IOrderedProvider
getPriority
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MODS_TOML
- See Also:
-
MANIFEST
- See Also:
-
-
Constructor Details
-
JarModsDotTomlModFileReader
public JarModsDotTomlModFileReader()
-
-
Method Details
-
createModFile
public static IModFile createModFile(JarContents contents, ModFileDiscoveryAttributes discoveryAttributes) -
getModType
-
manifestParser
-
read
@Nullable public @Nullable IModFile read(JarContents jar, ModFileDiscoveryAttributes discoveryAttributes) Description copied from interface:IModFileReaderProvides a mod from the givenjar.Throwing
ModLoadingExceptionwill report contained issues as the reason for incompatibility to players, unless another reader successfully reads the jar.Other thrown exceptions will be reported as errors and cause loading to fail.
- Specified by:
readin interfaceIModFileReader- Parameters:
jar- the mod jar contentsdiscoveryAttributes- The attributes relating to this mod files discovery.- Returns:
nullif this provider can't handle the given jar, otherwise the mod-file created from the given contents and attributes.
-
toString
-