Releases: Errored-Innovations/ConfigurationMaster
Bug fixes + Complete Separation from Bukkit
f9b2d2e Fixed ConfigFile#reload
85d5a28 Fixed comments not always getting fetched and placed properly
ac0e7ae Fixed option paths not being determined correctly
23148e8 Fixed ConfigSection#makeSectionLenient(String) not working properly
20c69e6 Fixed the API not removing the option if the value specified is null
de63db3 Moved API and Bukkit stuff into separate modules
c181aec Added a warning to CMFile saying the class is deprecated and should be replaced as soon as possible.
ed3eaab Fixed dependency/imports that come from Bukkit
Smaller Bug Fixes for Alpha
d327dbd Add any pending comments to the parent section rather than actual option.
f624b1d Fixed addComment(String, String) only working for sections, not actual options.
6767d0a Added ConfigSection#addComments(String, String...)
1712bf9 Throw IllegalStateException when trying to make a section where an option exists.
e727a0f Removed duplicating code in moveTo method.
Standalone Rewrite: Alpha Release
THIS IS AN ALPHA RELEASE AND NOT CONSIDERED STABLE WHATSOEVER. PLEASE DO NOT USE IT IN A PRODUCTION PLUGIN INTENDED FOR RELEASE (at least before the full CM 2.0.0 release) OR PRODUCTION ENVIRONMENT.
This has been tested exhaustively with production config files though, such as those from AdvancedTeleport and also from HeadsPlus v7.
Absolutely none of this is documented at this time. If you have any questions regarding the code, please ask me. None of the method or even field names in this release are final and will be changed without warning where required.
Whilst CM is not fully standalone (yet), the CMFile class has been deprecated and will be removed in the next major release. It is replaced by a new ConfigFile class that is standalone. You can either load a config file using CM's builtin checks for syntax errors:
ConfigFile config = ConfigFile.loadConfig(configFile);
or make your own checks by initialising a ConfigFile object:
ConfigFile config = new ConfigFile(configFile);
CM takes a large amount of inspiration from Bukkit for its config system, with a lot of method names taken from that with smaller variations.
To save a file after adding all default values, just use the ConfigFile#save
method:
config.save();
The main differences still remain:
- Methods like getInteger, getDouble, getFloat and etc. can parse string values as their own type, e.g. '7' will return 7 rather than 0 like in Bukkit's system.
- Calling getList on a value that is a single value (e.g.
foo: bar
) will return a list with that single value in it, so if you have a plugin that alternates between using lists and single values on a single option, this is for you. - A builtin
ConfigFile#reload
method that is probably broken right now so um have fun with that lol - Example options can be added to the config which only load when the file is new.
- A
ConfigFile#isNew
method that returns whether the config file is brand new or not. - The API will force an option order on the config as always.
- Safe loading saves a config file with bad syntax to a separate file.
As of currently, there is no title/header API included. That will be implemented in a future alpha release.
Title API, Partial Documentation and Internal changes
f949276 Add the override annotation where needed - Error
1fdfaf5 Add getPath as a method to the MemorySection interface - Error
853aeb9 Added forceExample and createExampleSection - Error
4bdc95d Implemented the Title API with full documentation - Error
78e874f Slight code cutdown - Error
de8c226 Add internal method getKey - Error
f3fc9b1 Added makeSectionLenient to ConfigSection interface - Error
a4053f8 Tweaked annotations - Error
9aa7831 Added null checks to the API implementations - Error
2c52ca7 Code cleanup/rearranging - Error
f12e645 Added some documentation - Error
127c019 Bumped version to v2.0.0-BETA-1 - Error
Bug fixes
c4a2d05 Fixed null options being added
70a291b Fixed NPE + problems when using getList on an array
03ff1a6 Also prevent null sections being added
41395ed Fixed moveTo not setting options to null
19b91b7 If the section is null, don't try to re-add a section
1256afd Fixed ConfigFile#reload re-adding sections made via addExample
bca2f54 Make ConfigFile#getExamples a hashset (better contains TC)
b231064 Make some methods private
61ef128 Added some javadocs
38de42a Bumped version
331d754 Fixed custom options added to lenient sections not saving if they were in sections
Bug Fixes, Getters and Small Additions
[ + ] Added a new moveTo method which allows you move old paths across files, e.g. moving an option from config.yml to new-config.yml.
[ + ] Grouped all necessary saving procedures into a new method called initiateSave.
[ + ] Added several getter methods, such as getInteger and getString. All allow default values to be passed through, and if a value provided is written as a string, methods like getInteger and getDouble still pick out the required value (such as '300.0' will return 300.0, whilst when using normal Bukkit methods, this returns 0.0).
[ + ] Added an isNew method, which returns whether the file is new or not.
[ + ] Fixed comments not persisting in examples.
[ + ] Fixed sections not being implemented at the end when not at the start of a pending comment.
[ + ] Pending comments (those added using addComment) are no longer added directly below an option with a parent, but added above the parent now.
Release
v1.0 Bump version
Release Candidate 2
[ + ] Fixed comments and sections added using #addComment(String) and #addSection(String) not being added when adding comments afterwards using #addDefault(String, Object, String) or #addDefault(String, Object, String, String)
Release Candidate 1
[ + ] Fixed #1
[ + ] Added #addLenientSection(String), which allows a developer to add a "lenient" section where the user can add anything.
v1.0-BETA-1
[ + ] Added setters to CMFile.
[ + ] Requires the user to call #load.
[ + ] Added annotations to stop code inputs screwing over the whole damn thing.
[ + ] Fixed comments not working when using #addDefault(String, Object)