Package net.neoforged.fml.config
Record Class LoadedConfig
java.lang.Object
java.lang.Record
net.neoforged.fml.config.LoadedConfig
- All Implemented Interfaces:
IConfigSpec.ILoadedConfig
record LoadedConfig(com.electronwill.nightconfig.core.CommentedConfig config, @Nullable Path path, ModConfig modConfig)
extends Record
implements IConfigSpec.ILoadedConfig
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLoadedConfig
(com.electronwill.nightconfig.core.CommentedConfig config, @Nullable Path path, ModConfig modConfig) Creates an instance of aLoadedConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.electronwill.nightconfig.core.CommentedConfig
config()
Returns the value of theconfig
record component.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 themodConfig
record component.@Nullable Path
path()
Returns the value of thepath
record component.void
save()
Saves the current value of theIConfigSpec.ILoadedConfig.config()
and dispatches a config reloading event.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
config
private final com.electronwill.nightconfig.core.CommentedConfig configThe field for theconfig
record component. -
path
The field for thepath
record component. -
modConfig
The field for themodConfig
record component.
-
-
Constructor Details
-
LoadedConfig
LoadedConfig(com.electronwill.nightconfig.core.CommentedConfig config, @Nullable @Nullable Path path, ModConfig modConfig) Creates an instance of aLoadedConfig
record class.- Parameters:
config
- the value for theconfig
record componentpath
- the value for thepath
record componentmodConfig
- the value for themodConfig
record component
-
-
Method Details
-
save
public void save()Description copied from interface:IConfigSpec.ILoadedConfig
Saves the current value of theIConfigSpec.ILoadedConfig.config()
and dispatches a config reloading event.- Specified by:
save
in interfaceIConfigSpec.ILoadedConfig
-
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)
. -
config
public com.electronwill.nightconfig.core.CommentedConfig config()Returns the value of theconfig
record component.- Specified by:
config
in interfaceIConfigSpec.ILoadedConfig
- Returns:
- the value of the
config
record component
-
path
Returns the value of thepath
record component.- Returns:
- the value of the
path
record component
-
modConfig
Returns the value of themodConfig
record component.- Returns:
- the value of the
modConfig
record component
-