Record Class MinecraftPatchedProvider.ProductionOptions

java.lang.Object
java.lang.Record
dev.architectury.loom.forge.minecraft.MinecraftPatchedProvider.ProductionOptions
Record Components:
atPatchedJar - 打过补丁并做过 access transform 的中间 Minecraft jar(重映射的输入)
forgeJar - Forge 的 universal jar
forgeUserdevJar - Forge 的 userdev jar
clientJar - client jar;不产出 client-extra 时为 null
serverJar - 服务端侧 jar(bootstrap 版本是抽取产物,否则是下载下来的 server jar); 只有 NeoForge 的 MERGED dist 清单会读它,其余情形为 null
mappings - 映射树;unobfuscated Forge 下为 null(那时没有映射配置)
clientExtra - 本次是否产出 client-extra
neoForge - 是否 NeoForge(决定是否挂 mixin 扩展、是否写 dist 清单)
forge - 是否 Forge(决定 client-extra 是否写空 MANIFEST)
unobfuscatedForge - 是否 unobfuscated Forge(最终 jar 走 userdev 合并分支、dist 清单用空映射树)
runtimeMojang - 是否在运行时使用 mojang 映射(决定 coremod 重映射的方向)
merged - 是否 MERGED 形态(决定 dist 清单是否按 client/server 分边)
remapNamespace - 重映射的源命名空间(Forge 为 srg、NeoForge 为 mojang)
coreModNamespace - coremod 重映射使用的源命名空间(生产命名空间)
distAttribute - 写进 dist 清单的 Minecraft-Dists 取值
Enclosing class:
MinecraftPatchedProvider

public static record MinecraftPatchedProvider.ProductionOptions(Path atPatchedJar, Path forgeJar, Path forgeUserdevJar, @Nullable Path clientJar, @Nullable Path serverJar, @Nullable net.fabricmc.mappingio.tree.MemoryMappingTree mappings, boolean clientExtra, boolean neoForge, boolean forge, boolean unobfuscatedForge, boolean runtimeMojang, boolean merged, String remapNamespace, String coreModNamespace, String distAttribute) extends Record
一次最终产物生产所需的全部输入与平台开关.

逐项对应执行期任务声明的输入,也逐项对应配置期路径自己持有的状态:两条路径都构造这一个对象, 生产实现只认它。这样「任务声明的输入」与「生产真正读入的输入」不可能不一致——否则 up-to-date 判定就是假的(改了输入却不重建),而等价性对照也验不出「接线接错了哪个输入」。

它必须**完全不依赖 Gradle 项目模型**(只有路径、布尔与字符串):任务对象会被配置缓存序列化, 任何指向 Project/SourceSet 的引用都会让整个 Forge 工程无法使用配置缓存。 平台开关因此在这里显式取值,而不是在执行期回读 extension。

  • Constructor Details

    • ProductionOptions

      public ProductionOptions(Path atPatchedJar, Path forgeJar, Path forgeUserdevJar, @Nullable Path clientJar, @Nullable Path serverJar, @Nullable net.fabricmc.mappingio.tree.MemoryMappingTree mappings, boolean clientExtra, boolean neoForge, boolean forge, boolean unobfuscatedForge, boolean runtimeMojang, boolean merged, String remapNamespace, String coreModNamespace, String distAttribute)
      Creates an instance of a ProductionOptions record class.
      Parameters:
      atPatchedJar - the value for the atPatchedJar record component
      forgeJar - the value for the forgeJar record component
      forgeUserdevJar - the value for the forgeUserdevJar record component
      clientJar - the value for the clientJar record component
      serverJar - the value for the serverJar record component
      mappings - the value for the mappings record component
      clientExtra - the value for the clientExtra record component
      neoForge - the value for the neoForge record component
      forge - the value for the forge record component
      unobfuscatedForge - the value for the unobfuscatedForge record component
      runtimeMojang - the value for the runtimeMojang record component
      merged - the value for the merged record component
      remapNamespace - the value for the remapNamespace record component
      coreModNamespace - the value for the coreModNamespace record component
      distAttribute - the value for the distAttribute 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.
    • atPatchedJar

      public Path atPatchedJar()
      Returns the value of the atPatchedJar record component.
      Returns:
      the value of the atPatchedJar record component
    • forgeJar

      public Path forgeJar()
      Returns the value of the forgeJar record component.
      Returns:
      the value of the forgeJar record component
    • forgeUserdevJar

      public Path forgeUserdevJar()
      Returns the value of the forgeUserdevJar record component.
      Returns:
      the value of the forgeUserdevJar record component
    • clientJar

      public @Nullable Path clientJar()
      Returns the value of the clientJar record component.
      Returns:
      the value of the clientJar record component
    • serverJar

      public @Nullable Path serverJar()
      Returns the value of the serverJar record component.
      Returns:
      the value of the serverJar record component
    • mappings

      public @Nullable net.fabricmc.mappingio.tree.MemoryMappingTree mappings()
      Returns the value of the mappings record component.
      Returns:
      the value of the mappings record component
    • clientExtra

      public boolean clientExtra()
      Returns the value of the clientExtra record component.
      Returns:
      the value of the clientExtra record component
    • neoForge

      public boolean neoForge()
      Returns the value of the neoForge record component.
      Returns:
      the value of the neoForge record component
    • forge

      public boolean forge()
      Returns the value of the forge record component.
      Returns:
      the value of the forge record component
    • unobfuscatedForge

      public boolean unobfuscatedForge()
      Returns the value of the unobfuscatedForge record component.
      Returns:
      the value of the unobfuscatedForge record component
    • runtimeMojang

      public boolean runtimeMojang()
      Returns the value of the runtimeMojang record component.
      Returns:
      the value of the runtimeMojang record component
    • merged

      public boolean merged()
      Returns the value of the merged record component.
      Returns:
      the value of the merged record component
    • remapNamespace

      public String remapNamespace()
      Returns the value of the remapNamespace record component.
      Returns:
      the value of the remapNamespace record component
    • coreModNamespace

      public String coreModNamespace()
      Returns the value of the coreModNamespace record component.
      Returns:
      the value of the coreModNamespace record component
    • distAttribute

      public String distAttribute()
      Returns the value of the distAttribute record component.
      Returns:
      the value of the distAttribute record component