loadOrAdapt

@NotNull()
public static @NotNull() YamlConfiguration loadOrAdapt(@NotNull() @NotNull() Plugin plugin, @NotNull() @NotNull() String fileName)

Loads a configuration file from the plugin folder, or creates it from defaults. Merges missing keys from defaults into existing files.

Return

The loaded YamlConfiguration.

Parameters

plugin

The plugin instance.

fileName

The name of the file (e.g., "config.yml").