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 aLoadedConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.electronwill.nightconfig.core.CommentedConfigconfig()Returns the value of theconfigrecord component.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 themodConfigrecord component.@Nullable Pathpath()Returns the value of thepathrecord component.voidsave()Saves the current value of theIConfigSpec.ILoadedConfig.config()and dispatches a config reloading event.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
config
private final com.electronwill.nightconfig.core.CommentedConfig configThe field for theconfigrecord component. -
path
The field for thepathrecord component. -
modConfig
The field for themodConfigrecord component.
-
-
Constructor Details
-
LoadedConfig
LoadedConfig(com.electronwill.nightconfig.core.CommentedConfig config, @Nullable @Nullable Path path, ModConfig modConfig) Creates an instance of aLoadedConfigrecord class.- Parameters:
config- the value for theconfigrecord componentpath- the value for thepathrecord componentmodConfig- the value for themodConfigrecord component
-
-
Method Details
-
save
public void save()Description copied from interface:IConfigSpec.ILoadedConfigSaves the current value of theIConfigSpec.ILoadedConfig.config()and dispatches a config reloading event.- Specified by:
savein 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 theconfigrecord component.- Specified by:
configin interfaceIConfigSpec.ILoadedConfig- Returns:
- the value of the
configrecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
modConfig
Returns the value of themodConfigrecord component.- Returns:
- the value of the
modConfigrecord component
-