-
-
Notifications
You must be signed in to change notification settings - Fork 25
Configuration
Amaury Carrade edited this page May 16, 2016
·
15 revisions
This component simplifies the management of commands with sub-commands and aliases.
| Documentation | JavaDoc |
|
Loader class (for loadComponents)
|
See below |
The old way to manage configuration is pretty annoying. You have to access the main plugin class everytime, the data types are limited, the configuration paths are hard-coded...
Using zLib, you transform this...
final Achievement achievement;
try
{
achievement = Achievement.valueOf(MainPluginClass.get().getConfig().getString("my_section.achievement", "OPEN_INVENTORY");
}
catch (IllegalArgumentException e)
{
achievement = Achievement.OPEN_INVENTORY;
MainPluginClass.getInstance().getLogger().warning("Invalid achievement set in config; using default value.");
}...into this:
final Achievement achievement = Config.MY_SECTION.ACHIEVEMENT.get();Better, eh?
Getting started
Components
Tools
Pour démarrer
Composants
- Commandes
- Configuration
- Internationalisation
- GUIs
- Barres latérales
- Services de travail en arrière plan
- NBT
-
Composants personnalisés
Outils