类 ModConfigSpec.ConfigValue<T>
java.lang.Object
net.neoforged.neoforge.common.ModConfigSpec.ConfigValue<T>
- 所有已实现的接口:
Supplier<T>
- 直接已知子类:
ModConfigSpec.BooleanValue
,ModConfigSpec.DoubleValue
,ModConfigSpec.EnumValue
,ModConfigSpec.IntValue
,ModConfigSpec.LongValue
- 封闭类:
ModConfigSpec
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
get()
Returns the configured value for the configuration setting, throwing if the config has not yet been loaded.返回 the default value for the configuration setting。getPath()
getRaw()
Returns the uncached value for the configuration setting, throwing if the config has not yet been loaded.getRaw
(com.electronwill.nightconfig.core.Config config, List<String> path, Supplier<T> defaultSupplier) getSpec()
next()
void
save()
void
Directly sets the value, without firing events or writing the config to disk.
-
字段详细资料
-
parent
-
path
-
defaultSupplier
-
cachedValue
-
spec
-
-
构造器详细资料
-
ConfigValue
ConfigValue(ModConfigSpec.Builder parent, List<String> path, Supplier<T> defaultSupplier)
-
-
方法详细资料
-
getPath
-
get
Returns the configured value for the configuration setting, throwing if the config has not yet been loaded.This getter is cached, and will respect the
world restart
andgame restart
options by not clearing its cache if one of those options are set.- 指定者:
get
在接口中Supplier<T>
- 返回:
- the configured value for the setting
- 抛出:
NullPointerException
- if theconfig spec
object that will contain this has not yet been builtIllegalStateException
- if the associated config has not yet been loaded
-
getRaw
Returns the uncached value for the configuration setting, throwing if the config has not yet been loaded.Do not call this for any other purpose than editing the value. Use
get()
instead. -
getRaw
-
getDefault
返回 the default value for the configuration setting。- 返回:
- the default value for the configuration setting
-
next
-
save
public void save() -
set
Directly sets the value, without firing events or writing the config to disk. Make sure to callModConfigSpec.save()
eventually. -
getSpec
-
clearCache
public void clearCache()
-