Record Class ModProcessorExtension.ModInfo

java.lang.Object
java.lang.Record
net.fabricmc.loom.configuration.mods.extension.ModProcessorExtension.ModInfo
Record Components:
inputJar - 原始 mod jar
mixinRemapType - 由 jar 内容派生的 mixin 重映射类型
inlineRefmap - 声明的 refmap 内联选项
Enclosing interface:
ModProcessorExtension

public static record ModProcessorExtension.ModInfo(Path inputJar, ArtifactMetadata.MixinRemapType mixinRemapType, boolean inlineRefmap) extends Record
一个 mod 在「是否 / 如何套用扩展」这件事上被用到的全部事实.

取代原先直接传 ModDependency:扩展本来就只用到输入 jar 路径与 mixin 重映射类型、是否内联 refmap 这三项,其中前两项由 jar 内容派生、第三项是 声明的选项。收窄成纯数据后,配置期与执行期(L3 任务)都能满足同一份契约, 而不需要把依赖对象带进任务。

  • Constructor Details

    • ModInfo

      public ModInfo(Path inputJar, ArtifactMetadata.MixinRemapType mixinRemapType, boolean inlineRefmap)
      Creates an instance of a ModInfo record class.
      Parameters:
      inputJar - the value for the inputJar record component
      mixinRemapType - the value for the mixinRemapType record component
      inlineRefmap - the value for the inlineRefmap record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • inputJar

      public Path inputJar()
      Returns the value of the inputJar record component.
      Returns:
      the value of the inputJar record component
    • mixinRemapType

      public ArtifactMetadata.MixinRemapType mixinRemapType()
      Returns the value of the mixinRemapType record component.
      Returns:
      the value of the mixinRemapType record component
    • inlineRefmap

      public boolean inlineRefmap()
      Returns the value of the inlineRefmap record component.
      Returns:
      the value of the inlineRefmap record component