Skip to content

Configuration with @Configurable

bcwadsworth edited this page Dec 29, 2014 · 2 revisions

The FeatureAPI mod automatically checks for classes with the @Configurable annotation. Each class within your minecraft loadout that has this annotation will be checked for the smaller annotations, namely @Writeable and @Excecutable.

##@Writable## Fields / Variables with this annotation will be overridden if the @Configurable annotation is present on the class AND the value of the annotation is mentioned with a different value. There are three arguments, one required, two optional. The first, value, is the UNIQUE designator of that field. This value is what the code checks against when deciding whether this value is the one overridden by a config. If two values are the same, both will be overridden. The next argument available is allowRuntime. This is a Boolean that checks whether changes are allowed during runtime. If this variable is true, a config GUI will be created for this variable if it is not complex (AKA not a list). Finally, allowPerWorld tells the program whether to change this variable during runtime when logging into a world when that world has an override value. If allowRuntime is false, this will not be checked.

##@Executable## Methods marked with @Executable will be allowed to be executed during PostInit for Global Configs for the arguments listed in the config files. The value is the UNIQUE designator of the method that allows the arguments to be run through the correct method. If two values are the same, the arguments will be run through both methods. allowPerWorld tells the program that world specific configs may trigger this executable.

##@ClassGlobalReset## The method marked with this annotation is responsible for resetting all values and settings (including any executable code) back to normal globals. This is passed to each of these annotations on world exit.

Clone this wiki locally