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.Logger
static final String
static final String
Fields inherited from interface net.neoforged.neoforgespi.locating.IOrderedProvider
DEFAULT_PRIORITY, HIGHEST_SYSTEM_PRIORITY, LOWEST_SYSTEM_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IModFile
createModFile
(cpw.mods.jarhandling.JarContents contents, ModFileDiscoveryAttributes discoveryAttributes) private static IModFile.Type
getModType
(cpw.mods.jarhandling.JarContents jar) static IModFileInfo
manifestParser
(IModFile mod) @Nullable IModFile
read
(cpw.mods.jarhandling.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, wait
Methods 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(cpw.mods.jarhandling.JarContents contents, ModFileDiscoveryAttributes discoveryAttributes) -
getModType
-
manifestParser
-
read
@Nullable public @Nullable IModFile read(cpw.mods.jarhandling.JarContents jar, ModFileDiscoveryAttributes discoveryAttributes) Description copied from interface:IModFileReader
Provides a mod from the givenjar
.Throwing
ModLoadingException
will 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:
read
in interfaceIModFileReader
- Parameters:
jar
- the mod jar contentsdiscoveryAttributes
- The attributes relating to this mod files discovery.- Returns:
null
if this provider can't handle the given jar, otherwise the mod-file created from the given contents and attributes.
-
toString
-