AbstractConfig
Base class for any plugin configuration to extend. It provides the config methods to create property delegates. Example usage:
class Configuration(plugin: Plugin): AbstractConfig(wrapConfig(plugin)) {
val value1: String by config("path1", default = "default value")
val value2: Int by config("path2.subpath2", default = 11)
val value3: List<Material> by config("path3", default = listOf(DIRT, GRASS, STONE)
val value4: CustomObject by config("path4", default = CustomObject("object"),
serialize = CustomObject::toString(),
deserialize = { CustomObject(it.toLowerCase()) }
)
}It also provides methods to save defaults saveDefaults and reload config values reloadConfig
Types
A property delegate for storage in a backing ConfigWrapper. See AbstractConfig for usage.
An abstraction for an underlying configuration store. Decouples config delegates from the underlying config framework.
Functions
Reloads all config values. Invokes the provided ConfigWrapper.reloadConfig.
Removes any keys from the configuration that are not associated with any registered delegate. This helps keeping the configuration file clean from legacy settings.
Writes all provided default values to the underlying config store and reloads the updated config values.