接口 IModLoadingState
- 所有已知实现类:
ModLoadingState
public interface IModLoadingState
A mod loading state. During mod loading, the mod loader transitions between states in a defined sorted list of states,
grouped into various
phases
.- 另请参阅:
-
方法概要
修饰符和类型方法说明default <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent>
Optional<CompletableFuture<Void>> buildTransition
(Executor syncExecutor, Executor parallelExecutor, ProgressMeter progressBar) Builds the transition task for this state with a blank pre-sync and post-sync task.<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) Builds the transition task for this state.返回 an optional runnable, which runs before starting the transition from this state to the next。message()
返回 a function returning a human-friendly message for this state。name()
返回 the name of this state。phase()
返回 the mod loading phase this state belongs to。previous()
返回 the name of the state immediately previous to this state。size()
-
方法详细资料
-
name
String name()返回 the name of this state。- 返回:
- the name of this state
-
previous
String previous()返回 the name of the state immediately previous to this state。 This may be a blank name, which indicates this is either the first mod loading state or an exceptional mod loading state (such as a situation where errors prevent the loading process from continuing normally).- 返回:
- the name of the state immediately previous to this state
-
phase
ModLoadingPhase phase()返回 the mod loading phase this state belongs to。 For exceptional mod loading states, this should beModLoadingPhase.ERROR
.- 返回:
- the mod loading phase this state belongs to
-
message
返回 a function returning a human-friendly message for this state。- 返回:
- a function returning a human-friendly message for this state
-
size
ToIntFunction<ModList> size()- 返回:
- a function that computes the size of this transition based on the size of the modlist. Used to compute progress.
-
inlineRunnable
返回 an optional runnable, which runs before starting the transition from this state to the next。- 返回:
- an optional runnable, which runs before starting the transition from this state to the next
- 另请参阅:
-
buildTransition
default <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent> Optional<CompletableFuture<Void>> buildTransition(Executor syncExecutor, Executor parallelExecutor, ProgressMeter progressBar) Builds the transition task for this state with a blank pre-sync and post-sync task.- 类型参数:
T
- a type of event fired on the mod-specific event bus- 参数:
syncExecutor
- a synchronous executorparallelExecutor
- a parallel executorprogressBar
- a progress meter for tracking progress- 返回:
- a transition task for this state
- 另请参阅:
-
buildTransition
<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) 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.- 类型参数:
T
- a type of event fired on the mod-specific event bus- 参数:
syncExecutor
- a synchronous executorparallelExecutor
- a parallel executorprogressBar
- a progress meter for tracking progresspreSyncTask
- a function which returns a task to run before event pre-dispatch hookpostSyncTask
- a function which returns a task to run after event post-dispatch hook- 返回:
- a transition task for this state
-