Class ModFile
java.lang.Object
net.neoforged.fml.loading.moddiscovery.ModFile
- All Implemented Interfaces:
IModFile
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.neoforged.neoforgespi.locating.IModFile
IModFile.Type
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ModFileDiscoveryAttributes
private @Nullable CompletableFuture
<ModFileScanData> private final cpw.mods.jarhandling.SecureJar
private final String
private List
<IModLanguageLoader> private static final org.slf4j.Logger
private final Manifest
private List
<ModFileParser.MixinConfig> private IModFileInfo
private final IModFile.Type
private final ModFileInfoParser
static final Attributes.Name
-
Constructor Summary
ConstructorsConstructorDescriptionModFile
(cpw.mods.jarhandling.SecureJar jar, ModFileInfoParser parser, IModFile.Type type, ModFileDiscoveryAttributes discoveryAttributes) ModFile
(cpw.mods.jarhandling.SecureJar jar, ModFileInfoParser parser, ModFileDiscoveryAttributes attributes) -
Method Summary
Modifier and TypeMethodDescriptionfindResource
(String... path) Invoked to find a particular resource in this mod file, with the given path.Get attributes about how this mod file was discovered.The raw file name of this file.The path to the underlying mod file.org.apache.maven.artifact.versioning.ArtifactVersion
The metadata info related to this particular file.Returns a list of all mods located inside this jar.The metadata scan result of all the classes located inside this file.cpw.mods.jarhandling.SecureJar
The secure jar that represents this mod file.The mod files specific string data substitution map.getType()
The type of the mod jar.void
boolean
private static IModFile.Type
parseType
(cpw.mods.jarhandling.SecureJar jar) void
void
setDiscoveryAttributes
(ModFileDiscoveryAttributes discoveryAttributes) void
setFileProperties
(Map<String, Object> fileProperties) toString()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
jarVersion
-
parser
-
discoveryAttributes
-
fileProperties
-
loaders
-
jar
private final cpw.mods.jarhandling.SecureJar jar -
modFileType
-
manifest
-
modFileInfo
-
futureScanResult
-
mixinConfigs
-
accessTransformers
-
TYPE
-
-
Constructor Details
-
ModFile
public ModFile(cpw.mods.jarhandling.SecureJar jar, ModFileInfoParser parser, ModFileDiscoveryAttributes attributes) -
ModFile
public ModFile(cpw.mods.jarhandling.SecureJar jar, ModFileInfoParser parser, IModFile.Type type, ModFileDiscoveryAttributes discoveryAttributes)
-
-
Method Details
-
getSubstitutionMap
Description copied from interface:IModFile
The mod files specific string data substitution map. The map returned here is used to interpolate values in the metadata of the included mods. Examples of where this is used in FML: While parsing the mods.toml file, keys like: ${file.xxxxx} are replaced with the values of this map, with keys xxxxx.- Specified by:
getSubstitutionMap
in interfaceIModFile
- Returns:
- The string substitution map used during metadata load.
-
getLoaders
-
getType
Description copied from interface:IModFile
The type of the mod jar. This primarily defines how and where this mod file is loaded into the module system. -
getFilePath
Description copied from interface:IModFile
The path to the underlying mod file.- Specified by:
getFilePath
in interfaceIModFile
- Returns:
- The path to the mod file.
-
getSecureJar
public cpw.mods.jarhandling.SecureJar getSecureJar()Description copied from interface:IModFile
The secure jar that represents this mod file.- Specified by:
getSecureJar
in interfaceIModFile
- Returns:
- The secure jar.
-
getModInfos
Description copied from interface:IModFile
Returns a list of all mods located inside this jar.If this method returns any entries then
IModFile.getType()
has to returnIModFile.Type.MOD
, else this mod file will not be loaded in the proper module layer in 1.17 and above.As such returning entries from this method is mutually exclusive with
invalid reference
#getLoaders()
- Specified by:
getModInfos
in interfaceIModFile
- Returns:
- The mods in this mod file.
-
getAccessTransformers
-
identifyMods
public boolean identifyMods() -
getMixinConfigs
-
scanFile
-
startScan
-
getScanResult
Description copied from interface:IModFile
The metadata scan result of all the classes located inside this file.- Specified by:
getScanResult
in interfaceIModFile
- Returns:
- The metadata scan result.
-
setFileProperties
-
findResource
Description copied from interface:IModFile
Invoked to find a particular resource in this mod file, with the given path.- Specified by:
findResource
in interfaceIModFile
- Parameters:
path
- The string representation of the path to find the mod resource on.- Returns:
- The
Path
that represents the requested resource.
-
identifyLanguage
public void identifyLanguage() -
toString
-
getFileName
Description copied from interface:IModFile
The raw file name of this file.- Specified by:
getFileName
in interfaceIModFile
- Returns:
- The raw file name.
-
getDiscoveryAttributes
Description copied from interface:IModFile
Get attributes about how this mod file was discovered.- Specified by:
getDiscoveryAttributes
in interfaceIModFile
-
setDiscoveryAttributes
-
getModFileInfo
Description copied from interface:IModFile
The metadata info related to this particular file.- Specified by:
getModFileInfo
in interfaceIModFile
- Returns:
- The info for this file.
-
getJarVersion
public org.apache.maven.artifact.versioning.ArtifactVersion getJarVersion() -
parseType
-