Class NestedLibraryModReader
java.lang.Object
net.neoforged.fml.loading.moddiscovery.readers.NestedLibraryModReader
- All Implemented Interfaces:
IModFileReader
,IOrderedProvider
This reader will essentially handle all files as plain Java libraries,
but will only do so for candidates that are embedded in recognized mod files.
If a plain jar-file (that is not a mod or markes as a library) is present on the classpath
or in the mods folder, this is usually a mistake.
However, if such a file is embedded in a mod jar, it is usually a deliberate decision by the modder.
-
Field Summary
Fields inherited from interface net.neoforged.neoforgespi.locating.IOrderedProvider
DEFAULT_PRIORITY, HIGHEST_SYSTEM_PRIORITY, LOWEST_SYSTEM_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the priority in which this provider will be called.@Nullable IModFile
read
(cpw.mods.jarhandling.JarContents jar, ModFileDiscoveryAttributes discoveryAttributes) Provides a mod from the givenjar
.toString()
-
Constructor Details
-
NestedLibraryModReader
public NestedLibraryModReader()
-
-
Method Details
-
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
-
getPriority
public int getPriority()Description copied from interface:IOrderedProvider
Gets the priority in which this provider will be called. A higher value means the provider will be called earlier.- Specified by:
getPriority
in interfaceIOrderedProvider
-