Package net.minecraftforge.fml
Record Class ModLoadingState
java.lang.Object
java.lang.Record
net.minecraftforge.fml.ModLoadingState
- All Implemented Interfaces:
IModLoadingState
public record ModLoadingState(String name, String previous, Function<ModList,String> message, ModLoadingPhase phase, Optional<Consumer<ModList>> inlineRunnable, Optional<IModStateTransition> transition)
extends Record
implements IModLoadingState
-
Field Summary
Modifier and TypeFieldDescriptionThe field for theinlineRunnable
record component.The field for themessage
record component.private final String
The field for thename
record component.private final ModLoadingPhase
The field for thephase
record component.private final String
The field for theprevious
record component.private final Optional<IModStateTransition>
The field for thetransition
record component. -
Constructor Summary
ConstructorDescriptionModLoadingState
(String name, String previous, Function<ModList, String> message, ModLoadingPhase phase, Optional<Consumer<ModList>> inlineRunnable, Optional<IModStateTransition> transition) Creates an instance of aModLoadingState
record class. -
Method Summary
Modifier and TypeMethodDescription<T extends net.minecraftforge.eventbus.api.Event & IModBusEvent>
Optional<CompletableFuture<List<Throwable>>>buildTransition
(Executor syncExecutor, Executor parallelExecutor, Function<Executor, CompletableFuture<Void>> preSyncTask, Function<Executor, CompletableFuture<Void>> postSyncTask) static ModLoadingState
empty
(String name, String previous, ModLoadingPhase phase) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinlineRunnable
record component.message()
Returns the value of themessage
record component.name()
Returns the value of thename
record component.phase()
Returns the value of thephase
record component.previous()
Returns the value of theprevious
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetransition
record component.static ModLoadingState
withInline
(String name, String previous, ModLoadingPhase phase, Consumer<ModList> inline) static ModLoadingState
withTransition
(String name, String previous, Function<ModList, String> message, ModLoadingPhase phase, IModStateTransition transition) static ModLoadingState
withTransition
(String name, String previous, ModLoadingPhase phase, IModStateTransition transition) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.fml.IModLoadingState
buildTransition
-
Field Details
-
name
The field for thename
record component. -
previous
The field for theprevious
record component. -
message
The field for themessage
record component. -
phase
The field for thephase
record component. -
inlineRunnable
The field for theinlineRunnable
record component. -
transition
The field for thetransition
record component.
-
-
Constructor Details
-
ModLoadingState
public ModLoadingState(String name, String previous, Function<ModList, String> message, ModLoadingPhase phase, Optional<Consumer<ModList>> inlineRunnable, Optional<IModStateTransition> transition) Creates an instance of aModLoadingState
record class.- Parameters:
name
- the value for thename
record componentprevious
- the value for theprevious
record componentmessage
- the value for themessage
record componentphase
- the value for thephase
record componentinlineRunnable
- the value for theinlineRunnable
record componenttransition
- the value for thetransition
record component
-
-
Method Details
-
buildTransition
public <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent> Optional<CompletableFuture<List<Throwable>>> buildTransition(Executor syncExecutor, Executor parallelExecutor, Function<Executor, CompletableFuture<Void>> preSyncTask, Function<Executor, CompletableFuture<Void>> postSyncTask) - Specified by:
buildTransition
in interfaceIModLoadingState
-
empty
-
withTransition
public static ModLoadingState withTransition(String name, String previous, ModLoadingPhase phase, IModStateTransition transition) -
withTransition
public static ModLoadingState withTransition(String name, String previous, Function<ModList, String> message, ModLoadingPhase phase, IModStateTransition transition) -
withInline
public static ModLoadingState withInline(String name, String previous, ModLoadingPhase phase, Consumer<ModList> inline) -
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
name
Returns the value of thename
record component.- Specified by:
name
in interfaceIModLoadingState
- Returns:
- the value of the
name
record component
-
previous
Returns the value of theprevious
record component.- Specified by:
previous
in interfaceIModLoadingState
- Returns:
- the value of the
previous
record component
-
message
Returns the value of themessage
record component.- Specified by:
message
in interfaceIModLoadingState
- Returns:
- the value of the
message
record component
-
phase
Returns the value of thephase
record component.- Specified by:
phase
in interfaceIModLoadingState
- Returns:
- the value of the
phase
record component
-
inlineRunnable
Returns the value of theinlineRunnable
record component.- Specified by:
inlineRunnable
in interfaceIModLoadingState
- Returns:
- the value of the
inlineRunnable
record component
-
transition
Returns the value of thetransition
record component.- Returns:
- the value of the
transition
record component
-