Package net.neoforged.neoforge.common
Class ModConfigSpec.ConfigValue<T>
java.lang.Object
net.neoforged.neoforge.common.ModConfigSpec.ConfigValue<T>
- All Implemented Interfaces:
Supplier<T>
- Direct Known Subclasses:
ModConfigSpec.BooleanValue,ModConfigSpec.DoubleValue,ModConfigSpec.EnumValue,ModConfigSpec.IntValue,ModConfigSpec.LongValue
- Enclosing class:
ModConfigSpec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Tprivate final ModConfigSpec.Builderprivate ModConfigSpecprivate static boolean -
Constructor Summary
ConstructorsConstructorDescriptionConfigValue(ModConfigSpec.Builder parent, List<String> path, Supplier<T> defaultSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidget()Returns the actual value for the configuration setting, throwing if the config has not yet been loaded.Returns the default value for the configuration setting.getPath()protected TgetRaw(com.electronwill.nightconfig.core.Config config, List<String> path, Supplier<T> defaultSupplier) next()voidsave()void
-
Field Details
-
USE_CACHES
private static boolean USE_CACHES -
parent
-
path
-
defaultSupplier
-
cachedValue
-
spec
-
-
Constructor Details
-
ConfigValue
ConfigValue(ModConfigSpec.Builder parent, List<String> path, Supplier<T> defaultSupplier)
-
-
Method Details
-
getPath
-
get
Returns the actual value for the configuration setting, throwing if the config has not yet been loaded.- Specified by:
getin interfaceSupplier<T>- Returns:
- the actual value for the setting
- Throws:
NullPointerException- if theconfig specobject that will contain this has not yet been builtIllegalStateException- if the associated config has not yet been loaded
-
getRaw
-
getDefault
Returns the default value for the configuration setting.- Returns:
- the default value for the configuration setting
-
next
-
save
public void save() -
set
-
clearCache
public void clearCache()
-