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 ModFileDiscoveryAttributesprivate @Nullable CompletableFuture<ModFileScanData> private final cpw.mods.jarhandling.SecureJarprivate final Stringprivate List<IModLanguageLoader> private static final org.slf4j.Loggerprivate final Manifestprivate List<ModFileParser.MixinConfig> private IModFileInfoprivate final IModFile.Typeprivate final ModFileInfoParserstatic 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.ArtifactVersionThe 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.SecureJarThe secure jar that represents this mod file.The mod files specific string data substitution map.getType()The type of the mod jar.voidbooleanprivate static IModFile.TypeparseType(cpw.mods.jarhandling.SecureJar jar) voidvoidsetDiscoveryAttributes(ModFileDiscoveryAttributes discoveryAttributes) voidsetFileProperties(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:IModFileThe 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:
getSubstitutionMapin interfaceIModFile- Returns:
- The string substitution map used during metadata load.
-
getLoaders
-
getType
Description copied from interface:IModFileThe 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:IModFileThe path to the underlying mod file.- Specified by:
getFilePathin interfaceIModFile- Returns:
- The path to the mod file.
-
getSecureJar
public cpw.mods.jarhandling.SecureJar getSecureJar()Description copied from interface:IModFileThe secure jar that represents this mod file.- Specified by:
getSecureJarin interfaceIModFile- Returns:
- The secure jar.
-
getModInfos
Description copied from interface:IModFileReturns 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:
getModInfosin interfaceIModFile- Returns:
- The mods in this mod file.
-
getAccessTransformers
-
identifyMods
public boolean identifyMods() -
getMixinConfigs
-
scanFile
-
startScan
-
getScanResult
Description copied from interface:IModFileThe metadata scan result of all the classes located inside this file.- Specified by:
getScanResultin interfaceIModFile- Returns:
- The metadata scan result.
-
setFileProperties
-
findResource
Description copied from interface:IModFileInvoked to find a particular resource in this mod file, with the given path.- Specified by:
findResourcein interfaceIModFile- Parameters:
path- The string representation of the path to find the mod resource on.- Returns:
- The
Paththat represents the requested resource.
-
identifyLanguage
public void identifyLanguage() -
toString
-
getFileName
Description copied from interface:IModFileThe raw file name of this file.- Specified by:
getFileNamein interfaceIModFile- Returns:
- The raw file name.
-
getDiscoveryAttributes
Description copied from interface:IModFileGet attributes about how this mod file was discovered.- Specified by:
getDiscoveryAttributesin interfaceIModFile
-
setDiscoveryAttributes
-
getModFileInfo
Description copied from interface:IModFileThe metadata info related to this particular file.- Specified by:
getModFileInfoin interfaceIModFile- Returns:
- The info for this file.
-
getJarVersion
public org.apache.maven.artifact.versioning.ArtifactVersion getJarVersion() -
parseType
-