kSpigotJsonConfig

inline fun <T : Any> kSpigotJsonConfig(file: File, saveAfterLoad: Boolean = false, noinline default: () -> T? = null): ConfigDelegate<T>

Creates a new ConfigDelegate object.

You can use this as a delegate (with by) or a normal object. (Delegate allows direct access to the config object, but does not provide save() or reload() methods.)

Parameters

default

Optional default config, which will be used if there is no config file and a new one should be created.

file

The path to the config.

saveAfterLoad

If true, the loaded config will be saved immediately. This is useful, if the config structure was changed and new default parameters were applied.

T

The class type of the config.