Package net.minecraftforge.fml
Record Class ModLoadingState
java.lang.Object
java.lang.Record
net.minecraftforge.fml.ModLoadingState
- Record Components:
- 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
- All Implemented Interfaces:
- 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.- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe field for theinlineRunnablerecord component.The field for themessagerecord component.private final StringThe field for thenamerecord component.private final ModLoadingPhaseThe field for thephaserecord component.private final StringThe field for thepreviousrecord component.private final ToIntFunction<ModList>The field for thesizerecord component.private final Optional<IModStateTransition>The field for thetransitionrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionModLoadingState(String name, String previous, Function<ModList, String> message, ToIntFunction<ModList> size, ModLoadingPhase phase, Optional<Consumer<ModList>> inlineRunnable, Optional<IModStateTransition> transition) Creates an instance of aModLoadingStaterecord class.
- 
Method SummaryModifier and TypeMethodDescription<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.static ModLoadingStateempty(String name, String previous, ModLoadingPhase phase) Returns an empty mod loading state.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinlineRunnablerecord component.message()Returns the value of themessagerecord component.name()Returns the value of thenamerecord component.phase()Returns the value of thephaserecord component.previous()Returns the value of thepreviousrecord component.size()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransitionrecord component.static ModLoadingStatewithInline(String name, String previous, ModLoadingPhase phase, Consumer<ModList> inline) Returns a mod loading state with an inline runnable and a default human-friendly message ofProcessing work [name].static ModLoadingStatewithTransition(String name, String previous, Function<ModList, String> message, ModLoadingPhase phase, IModStateTransition transition) Returns a mod loading state with state transition information and a custom human-friendly message function.static ModLoadingStatewithTransition(String name, String previous, ModLoadingPhase phase, IModStateTransition transition) Returns a mod loading state with state transition information and a default human-friendly message ofProcessing transition [name].Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.fml.IModLoadingStatebuildTransition
- 
Field Details- 
nameThe field for thenamerecord component.
- 
previousThe field for thepreviousrecord component.
- 
messageThe field for themessagerecord component.
- 
sizeThe field for thesizerecord component.
- 
phaseThe field for thephaserecord component.
- 
inlineRunnableThe field for theinlineRunnablerecord component.
- 
transitionThe field for thetransitionrecord component.
 
- 
- 
Constructor Details- 
ModLoadingStatepublic ModLoadingState(String name, String previous, Function<ModList, String> message, ToIntFunction<ModList> size, ModLoadingPhase phase, Optional<Consumer<ModList>> inlineRunnable, Optional<IModStateTransition> transition) Creates an instance of aModLoadingStaterecord class.- Parameters:
- name- the value for the- namerecord component
- previous- the value for the- previousrecord component
- message- the value for the- messagerecord component
- size- the value for the- sizerecord component
- phase- the value for the- phaserecord component
- inlineRunnable- the value for the- inlineRunnablerecord component
- transition- the value for the- transitionrecord component
 
 
- 
- 
Method Details- 
buildTransitionpublic <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) Description copied from interface:IModLoadingStateBuilds 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.- Specified by:
- buildTransitionin interface- IModLoadingState
- Type Parameters:
- T- a type of event fired on the mod-specific event bus
- Parameters:
- 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
- Returns:
- a transition task for this state
 
- 
emptyReturns an empty mod loading state. The mod loading state has a blank human-readable message, no inline runnable, and no state transition information.- Parameters:
- 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
- Returns:
- an empty mod loading state
 
- 
withTransitionpublic static ModLoadingState withTransition(String name, String previous, ModLoadingPhase phase, IModStateTransition transition) Returns a mod loading state with state transition information and a default human-friendly message ofProcessing transition [name].- Parameters:
- 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
- Returns:
- a mod loading state with state transition information and a default message
 
- 
withTransitionpublic static ModLoadingState withTransition(String name, String previous, Function<ModList, String> message, ModLoadingPhase phase, IModStateTransition transition) Returns a mod loading state with state transition information and a custom human-friendly message function.- Parameters:
- 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
- Returns:
- a mod loading state with state transition information and a custom message
 
- 
withInlinepublic static ModLoadingState withInline(String name, String previous, ModLoadingPhase phase, Consumer<ModList> inline) Returns a mod loading state with an inline runnable and a default human-friendly message ofProcessing work [name].- Parameters:
- 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
- Returns:
- a mod loading state with an inline runnable and default message
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 withObjects::equals(Object,Object).
- 
nameReturns the value of thenamerecord component.- Specified by:
- namein interface- IModLoadingState
- Returns:
- the value of the namerecord component
 
- 
previousReturns the value of thepreviousrecord component.- Specified by:
- previousin interface- IModLoadingState
- Returns:
- the value of the previousrecord component
 
- 
messageReturns the value of themessagerecord component.- Specified by:
- messagein interface- IModLoadingState
- Returns:
- the value of the messagerecord component
 
- 
sizeReturns the value of thesizerecord component.- Specified by:
- sizein interface- IModLoadingState
- Returns:
- the value of the sizerecord component
 
- 
phaseReturns the value of thephaserecord component.- Specified by:
- phasein interface- IModLoadingState
- Returns:
- the value of the phaserecord component
 
- 
inlineRunnableReturns the value of theinlineRunnablerecord component.- Specified by:
- inlineRunnablein interface- IModLoadingState
- Returns:
- the value of the inlineRunnablerecord component
- See Also:
 
- 
transitionReturns the value of thetransitionrecord component.- Returns:
- the value of the transitionrecord component
 
 
-