RefineryConfiguration (xyz.refineryteam.refinerycore.api.config) maps a YAML file directly onto fields of a Java class using annotations, so you don’t hand-write getConfig().getString(...) calls scattered across your plugin.
Defining a configuration class
ExtendRefineryConfiguration, annotate the class with @ConfigFile, and annotate fields with @ConfigEntry:
MainConfig.java
Annotations
Nested sections
Group related entries into a nested object using@ConfigSection:
MainConfig.java
Lifecycle
Plugin.java
Supported field types
Primitives and their boxed equivalents (int/Integer, long/Long, double/Double, float/Float, boolean/Boolean), String, List, Map, and nested @ConfigSection types are all handled automatically. Values read back from YAML are cast to the field’s declared type — for example, a YAML integer read into a long field is safely widened.
Example: reload command integration
Sincereload() can throw (e.g. malformed YAML), pair it with CommandContext#executiveContext from the command framework:
PluginCommand.java

