Class ConfigEvents

java.lang.Object
net.ixdarklord.coolcatcore.api.config.ConfigEvents

public final class ConfigEvents extends Object
Every config's lifecycle, for code watching configs it didn't declare. A config's own listeners (Config.addListener(Config.ChangeListener), ConfigValue.addListener(ConfigValue.ChangeListener)) are usually simpler.
ConfigEvents.LOADED.register(config -> LOGGER.info("Loaded {}", config.id()));
ConfigEvents.RELOADED.register(config -> rebuildCaches());
ConfigEvents.VALUE_CHANGED.register((config, value, oldValue, newValue) -> {
    if (value == MyConfig.RENDER_DISTANCE) refreshRenderer();
});
In order, a reload that changes values fires VALUE_CHANGED for each value, then CHANGED once, then RELOADED. Listeners run on the thread that caused them: the server or client thread for commands, screens, syncs and hot reloads.