Class MycelConfig
java.lang.Object
my.celium.org.config.MycelConfig
Live handle for one mod's configuration, backed by
config/<modid>.json.
Obtained once via ConfigBuilder.build(). Values are read through
the ConfigValue instances returned by the builder; this handle adds
lifecycle operations: save(), reload(), resetAll()
and category introspection for the config screen.
-
Method Summary
Modifier and TypeMethodDescriptionDistinct categories in first-use order (root""first when present).file()ConfigValue<?> Finds a value by path ("key"or"category.key").booleanReturnstruewhen every value holds its default.metadata()modId()voidreload()Re-reads the file; values that changed fire their listeners.voidresetAll()Resets every value to its default and saves.voidsave()Writes the file when anything changed since the last save/load.intList<ConfigValue<?>> values()All values in declaration order.List<ConfigValue<?>> Values of one category in declaration order.
-
Method Details
-
metadata
-
modId
-
values
All values in declaration order. -
categories
-
valuesIn
Values of one category in declaration order. -
find
Finds a value by path ("key"or"category.key").- Returns:
- the value, or
nullwhen nothing (or ambiguous bare key) matches - See Also:
-
file
-
schemaVersion
public int schemaVersion() -
save
public void save()Writes the file when anything changed since the last save/load. -
reload
public void reload()Re-reads the file; values that changed fire their listeners. -
resetAll
public void resetAll()Resets every value to its default and saves. -
isDefault
public boolean isDefault()Returnstruewhen every value holds its default.
-