Package dev.architectury.loom.metadata
Class ModMetadataFiles
java.lang.Object
dev.architectury.loom.metadata.ModMetadataFiles
Utilities for reading mod metadata files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ModMetadataFile用内存中的原文重建模组元数据文件,供跨项目数据(LoomProjectData)在依赖方复原非 FMJ 形态.static @Nullable ModMetadataFilefromDirectory(Path directory) Reads the mod metadata file from a directory.static @Nullable ModMetadataFileReads the mod metadata file from a jar.static @Nullable ModMetadataFilefromSourceSets(org.gradle.api.Project project, org.gradle.api.tasks.SourceSet... sourceSets) Reads the first mod metadata file from source sets.
-
Constructor Details
-
ModMetadataFiles
public ModMetadataFiles()
-
-
Method Details
-
fromBytes
用内存中的原文重建模组元数据文件,供跨项目数据(LoomProjectData)在依赖方复原非 FMJ 形态.- Parameters:
fileName-ModMetadataFile.getFileName()返回的文件名bytes- 元数据文件的原始内容- Returns:
- 重建的元数据文件;文件名不在已知范围内(例如带
[erroring]后缀)时返回null
-
fromJar
Reads the mod metadata file from a jar.- Parameters:
jar- the path to the jar file- Returns:
- the mod metadata file, or
nullif not found - Throws:
IOException
-
fromDirectory
Reads the mod metadata file from a directory.- Parameters:
directory- the path to the directory- Returns:
- the mod metadata file, or
nullif not found - Throws:
IOException
-
fromSourceSets
public static @Nullable ModMetadataFile fromSourceSets(org.gradle.api.Project project, org.gradle.api.tasks.SourceSet... sourceSets) throws IOException Reads the first mod metadata file from source sets.- Parameters:
project- the project owning the source setssourceSets- the source sets to read from- Returns:
- the mod metadata file, or
nullif not found - Throws:
IOException
-