记录类 ModLoadingState

java.lang.Object
java.lang.Record
net.minecraftforge.fml.ModLoadingState
记录组件:
name - the name of this state
previous - the name of the state immediately previous to this state
message - a function returning a human-friendly message for this state
phase - the mod loading phase this state belongs to
inlineRunnable - an optional runnable, which runs before starting the transition from this state to the next
transition - optional state transition information
所有已实现的接口:
IModLoadingState

public record ModLoadingState(String name, String previous, Function<ModList,String> message, ToIntFunction<ModList> size, ModLoadingPhase phase, Optional<Consumer<ModList>> inlineRunnable, Optional<IModStateTransition> transition) extends Record implements IModLoadingState
Implementation of the IModLoadingState interface.
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • buildTransition

      public <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent> Optional<CompletableFuture<Void>> buildTransition(Executor syncExecutor, Executor parallelExecutor, ProgressMeter progressBar, Function<Executor,CompletableFuture<Void>> preSyncTask, Function<Executor,CompletableFuture<Void>> postSyncTask)
      从接口复制的说明: IModLoadingState
      Builds the transition task for this state. The pre-sync and post-sync task functions allow the transition builder to run these tasks on the same executor as the actual event dispatch and pre/post hooks.
      指定者:
      buildTransition 在接口中 IModLoadingState
      类型参数:
      T - a type of event fired on the mod-specific event bus
      参数:
      syncExecutor - a synchronous executor
      parallelExecutor - a parallel executor
      progressBar - a progress meter for tracking progress
      preSyncTask - a function which returns a task to run before event pre-dispatch hook
      postSyncTask - a function which returns a task to run after event post-dispatch hook
      返回:
      a transition task for this state
    • empty

      @Deprecated(since="1.21.3", forRemoval=true) public static ModLoadingState empty(String name, String previous, ModLoadingPhase phase)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Use the builder
      返回 an empty mod loading state。 The mod loading state has a blank human-readable message, no inline runnable, and no state transition information.
      参数:
      name - the name of the state
      previous - the name of the immediately previous state to this state
      phase - the mod loading phase the state belongs to
      返回:
      an empty mod loading state
    • withTransition

      @Deprecated(since="1.21.3", forRemoval=true) public static ModLoadingState withTransition(String name, String previous, ModLoadingPhase phase, IModStateTransition transition)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Use the builder
      Returns a mod loading state with state transition information and a default human-friendly message of Processing transition [name].
      参数:
      name - the name of the state
      previous - the name of the immediately previous state to this state
      phase - the mod loading phase the state belongs to
      transition - the state transition information
    • withTransition

      @Deprecated(since="1.21.3", forRemoval=true) public static ModLoadingState withTransition(String name, String previous, Function<ModList,String> message, ModLoadingPhase phase, IModStateTransition transition)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Use the builder
      Returns a mod loading state with state transition information and a custom human-friendly message function.
      参数:
      name - the name of the state
      previous - the name of the immediately previous state to this state
      message - a function returning a human-friendly message for this state
      phase - the mod loading phase the state belongs to
      transition - the state transition information
      返回:
      a mod loading state with state transition information and a custom message
    • withInline

      @Deprecated(since="1.21.3", forRemoval=true) public static ModLoadingState withInline(String name, String previous, ModLoadingPhase phase, Consumer<ModList> inline)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Use the builder
      Returns a mod loading state with an inline runnable and a default human-friendly message of Processing work [name].
      参数:
      name - the name of the state
      previous - the name of the immediately previous state to this state
      phase - the mod loading phase the state belongs to
      inline - an optional runnable, which runs before starting the transition from this state to the next
      返回:
      a mod loading state with an inline runnable and default message
    • of

      public static ModLoadingState.Builder of(String name, ModLoadingPhase phase)
    • toString

      public final String toString()
      返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。
      指定者:
      toString 在类中 Record
      返回:
      此对象的字符串表示形式
    • hashCode

      public final int hashCode()
      返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。
      指定者:
      hashCode 在类中 Record
      返回:
      此对象的哈希代码值
    • equals

      public final boolean equals(Object o)
      指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用 Objects::equals(Object,Object) 进行比较。
      指定者:
      equals 在类中 Record
      参数:
      o - 要与之进行比较的对象
      返回:
      如果此对象与 o 参数相同,则为 true;否则为 false
    • name

      public String name()
      返回 name 记录组件的值。
      指定者:
      name 在接口中 IModLoadingState
      返回:
      name 记录组件的值
    • previous

      public String previous()
      返回 previous 记录组件的值。
      指定者:
      previous 在接口中 IModLoadingState
      返回:
      previous 记录组件的值
    • message

      public Function<ModList,String> message()
      返回 message 记录组件的值。
      指定者:
      message 在接口中 IModLoadingState
      返回:
      message 记录组件的值
    • size

      public ToIntFunction<ModList> size()
      返回 size 记录组件的值。
      指定者:
      size 在接口中 IModLoadingState
      返回:
      size 记录组件的值
    • phase

      public ModLoadingPhase phase()
      返回 phase 记录组件的值。
      指定者:
      phase 在接口中 IModLoadingState
      返回:
      phase 记录组件的值
    • inlineRunnable

      public Optional<Consumer<ModList>> inlineRunnable()
      返回 inlineRunnable 记录组件的值。
      指定者:
      inlineRunnable 在接口中 IModLoadingState
      返回:
      inlineRunnable 记录组件的值
      另请参阅:
    • transition

      public Optional<IModStateTransition> transition()
      返回 transition 记录组件的值。
      返回:
      transition 记录组件的值