Package net.minecraftforge.fml
Interface IModLoadingState
- All Known Implementing Classes:
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.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent>
Optional<CompletableFuture<Void>>buildTransition(Executor syncExecutor, Executor parallelExecutor) 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, Function<Executor, CompletableFuture<Void>> preSyncTask, Function<Executor, CompletableFuture<Void>> postSyncTask) Builds the transition task for this state.Returns an optional runnable, which runs before starting the transition from this state to the next.message()Returns a function returning a human-friendly message for this state.name()Returns the name of this state.phase()Returns the mod loading phase this state belongs to.previous()Returns the name of the state immediately previous to this state.
-
Method Details
-
name
String name()Returns the name of this state.- Returns:
- the name of this state
-
previous
String previous()Returns 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).- Returns:
- the name of the state immediately previous to this state
-
phase
ModLoadingPhase phase()Returns the mod loading phase this state belongs to. For exceptional mod loading states, this should beModLoadingPhase.ERROR.- Returns:
- the mod loading phase this state belongs to
-
message
Returns a function returning a human-friendly message for this state.- Returns:
- a function returning a human-friendly message for this state
-
inlineRunnable
Returns an optional runnable, which runs before starting the transition from this state to the next.- Returns:
- an optional runnable, which runs before starting the transition from this state to the next
- See Also:
-
buildTransition
default <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent> Optional<CompletableFuture<Void>> buildTransition(Executor syncExecutor, Executor parallelExecutor) Builds the transition task for this state with a blank pre-sync and post-sync task.- Type Parameters:
T- a type of event fired on the mod-specific event bus- Parameters:
syncExecutor- a synchronous executorparallelExecutor- a parallel executor- Returns:
- a transition task for this state
- See Also:
-
buildTransition
<T extends net.minecraftforge.eventbus.api.Event & IModBusEvent> Optional<CompletableFuture<Void>> buildTransition(Executor syncExecutor, Executor parallelExecutor, 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.- Type Parameters:
T- a type of event fired on the mod-specific event bus- Parameters:
syncExecutor- a synchronous executorparallelExecutor- a parallel executorpreSyncTask- 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- Returns:
- a transition task for this state
-