Perform validations, print messages, whatever you want.
Run methods before or after the config is reloaded, all you have to do it annotate them with the respective annotation. Both public and privateno-args methods are supported. They can be on the base class, or any parent class.
By default, these methods run on the main thread, but you can specify async on the annotation parameter to run the method on another thread (ForkJoinPool).
importcom.github.secretx33.sccfg.api.annotation.*;@ConfigurationpublicclassMyConfig { @BeforeReloadpublicvoiddoBefore() {// doing something before config is reloaded } @BeforeReload(async =true)privatevoiddoBeforeAsync() {// doing something before config is reloaded, but async } @AfterReloadprivatevoiddoAfter() {// doing something after config is reloaded } @AfterReload(async =true)publicvoiddoAfterAsync() {// doing another thing after config is reloaded, but async }}
import com.github.secretx33.sccfg.api.annotation.*@ConfigurationclassMyConfig {@BeforeReloadfundoBefore() {// doing something before config is reloaded }@BeforeReload(async =true)privatefundoBeforeAsync() {// doing something before config is reloaded, but async }@AfterReloadprivatefundoAfter() {// doing something after config is reloaded }@AfterReload(async =true)fundoAfterAsync() {// doing another thing after config is reloaded, but async }}