Class MycelConfig

java.lang.Object
my.celium.org.config.MycelConfig

public final class MycelConfig extends Object
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 Details

    • metadata

      public ModMetadata metadata()
    • modId

      public String modId()
    • values

      public List<ConfigValue<?>> values()
      All values in declaration order.
    • categories

      public List<String> categories()
      Distinct categories in first-use order (root "" first when present).
    • valuesIn

      public List<ConfigValue<?>> valuesIn(String category)
      Values of one category in declaration order.
    • find

      public ConfigValue<?> find(String path)
      Finds a value by path ("key" or "category.key").
      Returns:
      the value, or null when nothing (or ambiguous bare key) matches
      See Also:
    • file

      public Path 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()
      Returns true when every value holds its default.