Package net.fabricmc.loom.internal
Record Class LoomProjectData.ModData
java.lang.Object
java.lang.Record
net.fabricmc.loom.internal.LoomProjectData.ModData
- Record Components:
json- 模组元数据 JSON,保持源对象的原始键(不补schemaVersion,仅在缺失时补 id/version 便于识别)resources- 需要在依赖方复现的资源(mixin 配置、AT/AW、javadoc 等)及其内容metadataFileName- 源对象的元数据文件名;仅当源对象来自ModMetadataFabricModJson(Forge/NeoForge 的 mods.toml、architectury.common.json 等 非 FMJ 形态)时非空,用于在依赖方重建同类视图
- All Implemented Interfaces:
Serializable
- Enclosing class:
LoomProjectData
public static record LoomProjectData.ModData(String json, Map<String,byte[]> resources, @Nullable String metadataFileName)
extends Record
implements Serializable
单个模组的跨项目数据.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.json()Returns the value of thejsonrecord component.@Nullable StringReturns the value of themetadataFileNamerecord component.Returns the value of theresourcesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModData
供只关心元数据与资源的调用方(含既有测试)使用的便捷构造方法. -
ModData
Creates an instance of aModDatarecord class.- Parameters:
json- the value for thejsonrecord componentresources- the value for theresourcesrecord componentmetadataFileName- the value for themetadataFileNamerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
json
Returns the value of thejsonrecord component.- Returns:
- the value of the
jsonrecord component
-
resources
Returns the value of theresourcesrecord component.- Returns:
- the value of the
resourcesrecord component
-
metadataFileName
Returns the value of themetadataFileNamerecord component.- Returns:
- the value of the
metadataFileNamerecord component
-