Record Class ProcessorContextImpl

java.lang.Object
java.lang.Record
net.fabricmc.loom.configuration.processors.ProcessorContextImpl
All Implemented Interfaces:
ProcessorContext

public record ProcessorContextImpl(ConfigContext configContext, MinecraftJar minecraftJar) extends Record implements ProcessorContext
  • Constructor Details

    • ProcessorContextImpl

      public ProcessorContextImpl(ConfigContext configContext, MinecraftJar minecraftJar)
      Creates an instance of a ProcessorContextImpl record class.
      Parameters:
      configContext - the value for the configContext record component
      minecraftJar - the value for the minecraftJar record component
  • Method Details

    • isSplit

      public boolean isSplit()
      Description copied from interface: ProcessorContext
      本上下文服务的 jar 是否来自 split(客户端与服务端分开产出)配置.

      split 配置会产出两个 jar,它们与 client only / server only 配置产出的 jar 在 ProcessorContext.isMerged()、ProcessorContext.includesClient()、ProcessorContext.includesServer() 上完全一致: 单看一个 jar 无法区分「这是 split 的一半」还是「本来就是单边配置」。 只有本方法能给出这一信息,需要在 split 下改变行为的 processor 必须用它判断。

      Specified by:
      isSplit in interface ProcessorContext
      Returns:
      本 jar 是否属于 split 配置
    • isMerged

      public boolean isMerged()
      Specified by:
      isMerged in interface ProcessorContext
    • includesClient

      public boolean includesClient()
      Specified by:
      includesClient in interface ProcessorContext
    • includesServer

      public boolean includesServer()
      Specified by:
      includesServer in interface ProcessorContext
    • createRemapper

      public LazyCloseable<net.fabricmc.tinyremapper.TinyRemapper> createRemapper(MappingsNamespace from, MappingsNamespace to)
      Specified by:
      createRemapper in interface ProcessorContext
    • getMappings

      public net.fabricmc.mappingio.tree.MemoryMappingTree getMappings()
      Specified by:
      getMappings in interface ProcessorContext
    • disableObfuscation

      public boolean disableObfuscation()
      Specified by:
      disableObfuscation in interface ProcessorContext
    • getProductionNamespace

      public MappingsNamespace getProductionNamespace()
      Specified by:
      getProductionNamespace in interface ProcessorContext
    • getIntermediaryNamespace

      public MappingsNamespace getIntermediaryNamespace()
      Description copied from interface: ProcessorContext
      本平台在工具链中自带数据文件所用的命名空间:fabric/quilt 为 intermediary、 forge 为 srg、neoforge 为 mojang.

      它与 ProcessorContext.getProductionNamespace() 不是一回事:后者可以被用户配置成 official 之类的取值,而平台自带的文件(例如 Forge 的 accesstransformer.cfg) 始终写在平台自己的命名空间里。

      Specified by:
      getIntermediaryNamespace in interface ProcessorContext
      Returns:
      平台默认命名空间
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • configContext

      public ConfigContext configContext()
      Returns the value of the configContext record component.
      Returns:
      the value of the configContext record component
    • minecraftJar

      public MinecraftJar minecraftJar()
      Returns the value of the minecraftJar record component.
      Returns:
      the value of the minecraftJar record component