Been a while since I've been coding Bukkit. http://dev.bukkit.org/bukkit-plugins/kitadder My plugin deletes comments in Essentials config, and it basically messes up the save. Any idea how to let it not altar configurations? I wanna fix this for people, but I'm unsure since I haven't been at it for a while. Thanks~
@Ravada We can't help you unless you show us your code. Do you have a specific class or method that edits the Essentials config?
Correct me if I'm wrong but the #save function will remove comments except a header. Edit: The only way I know how to keep the comments is through getting the "resource file" in eclipse and copying it to the target file.
Really unsure now. Can someone who has a plugin that writes to config and doesn't delete comments help?
saveResource, how could I use that to load my config, and save it. So far, I'm copying the Essentials config to my KitAdder folder, then I wanna try load the Essentials config, then make the changes using saveResource, so the comments aren't removed, then copy the file back.
Well.. You can't. If you edit using bukkits native YamlConfiguration it will remove it no matter what you do. You can make your own parser. SnakeYAML is bundled with bukkit, but it would take a while =(
As I said, but thats a big hassle, or find a library that fixed it. Basically it is possible, but it takes work.
@ArsenArsen Well I guess I could edit my plugin to just, put in a config file what the people should paste into Essentials then.