Module Registry
Module Registry
Section titled “Module Registry”The module registry is DaisyConfig’s first-class API for:
modules/<category>/<module>/settings.ymlmodules/<category>/<module>/lang.yml
DaisyModuleDefinition<S> object Declares one category/module pair and its managed settings and lang files.
DaisyModuleConfig<S> object Typed module runtime value containing settings and optional lang.
DaisyModuleHandle<S> object Managed module handle exposing current settings and a DaisyCore text source.
DaisyModuleRegistry object Lookup and reload surface for all registered modules.
DaisyModules.load object Loads the registry from plugin-managed module definitions.
require(category, module) object Fetches one typed module handle by category and module name.
reloadAll() object Reloads all registered modules while preserving last-good state on failure.
migrateAll() object Runs managed merge and migration across all modules and aggregates reports.
Lookup example
Section titled “Lookup example”val spawn = registry.require<SpawnSettings>("commands", "spawn")val delay = spawn.current.settings.delaySecondsReload example
Section titled “Reload example”when (val result = registry.reloadAll()) { is DaisyManagedBundleReloadResult.Success -> logger.info("Reloaded ${result.value.size} modules.") is DaisyManagedBundleReloadResult.Failure -> logger.warning(result.errors.joinToString { "${it.path}: ${it.message}" })}What a module handle owns
Section titled “What a module handle owns”One DaisyModuleHandle<S> gives you:
definitioncurrent.settingscurrent.langtextSourcemigrate()
That makes module lang/settings pairing a first-class DaisyConfig concern instead of a plugin-local convention.