Package net.minecraftforge.common
Class ForgeConfigSpec.ConfigValue<T>
java.lang.Object
net.minecraftforge.common.ForgeConfigSpec.ConfigValue<T>
- All Implemented Interfaces:
Supplier<T>
- Direct Known Subclasses:
ForgeConfigSpec.BooleanValue
,ForgeConfigSpec.ByteValue
,ForgeConfigSpec.DoubleValue
,ForgeConfigSpec.EnumValue
,ForgeConfigSpec.FloatValue
,ForgeConfigSpec.IntValue
,ForgeConfigSpec.LongValue
,ForgeConfigSpec.ShortValue
- Enclosing class:
- ForgeConfigSpec
-
Field Summary
Modifier and TypeFieldDescriptionprivate T
private final ForgeConfigSpec.Builder
private ForgeConfigSpec
private static final boolean
-
Constructor Summary
ConstructorDescriptionConfigValue
(ForgeConfigSpec.Builder parent, List<String> path, Supplier<T> defaultSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
get()
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 T
getRaw
(com.electronwill.nightconfig.core.Config config, List<String> path, Supplier<T> defaultSupplier) next()
void
save()
void
-
Field Details
-
USE_CACHES
private static final boolean USE_CACHES- See Also:
-
parent
-
path
-
defaultSupplier
-
cachedValue
-
spec
-
-
Constructor Details
-
ConfigValue
ConfigValue(ForgeConfigSpec.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:
get
in interfaceSupplier<T>
- Returns:
- the actual value for the setting
- Throws:
NullPointerException
- if theconfig spec
object 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()
-