Configs

object Configs

Utility for loading and managing configurations.

This singleton provides static methods for loading configuration data from files into Kotlin objects.

Functions

Link copied to clipboard
inline fun <T : Any> load(file: File): T

Loads the configuration of type T from the specified file.

inline fun <T : Any> load(plugin: Plugin, autoReload: Boolean = false, noinline onReload: (T) -> Unit = {}): T
fun <T : Any> load(plugin: Plugin, clazz: KClass<T>, autoReload: Boolean = false, onReload: (T) -> Unit = {}): T

Loads the configuration of type T for the plugin.

Link copied to clipboard
fun reload()

Clears the configuration cache.

Link copied to clipboard
fun save(file: File, config: Any)

Saves the config object to the specified file.

fun save(plugin: Plugin, config: Any)

Saves the config object to the "config.yml" file in the plugin's data folder.