Solved Config.yml messes up!

Discussion in 'Plugin Development' started by ItsLeandro, Jan 25, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ItsLeandro

    Hi guys,
    So I make plugins and I have some plugins made with a config.yml. 2 months ago they just worked fine, but now if I make a config.yml in eclipse, it just shows what I want but if I export the plugin and want to try the plugin out, the whole config.yml gets messed up. I have no idea how this is possible. I am bothered with it already quite long and thought that maybe making a thread about it could help me.

    Here are 2 screenshots of a simple plugin with a config.yml:
    http://gyazo.com/bc7ada6b575299e85931502da640b0b0
    ^^ This is how it looks in eclipse, just how I want it ^^

    http://gyazo.com/7e90f84e79978f813738a7e5d5bb84e3
    ^^ This is how it looks if I am testing the plugin, completely messed up ^^

    Help is appreciated!

    Kind regards,
    ItsLeandro
     
  2. Offline

    L33m4n123

    you would need to use your own YML generation. AFAIK default Bukkit config YML creation does not support emtpy lines, comments and so on
     
  3. Offline

    CubieX

    Comments in the header section before the very first key are ok.
    Empty lines have to be comments.
    Example:
    Code:
    #
    # My header
    #
    key1: asd
    #
    key2: bcd
    But comments after the first key will be deleted as soon as you save the config file again.
    So as long as you are only reading from config, you can have comments between keys.

    Otherwise you need to use your own YAML config management, like L33m4n123 already explained.
     
  4. Offline

    ItsLeandro

    Thanks guys! I fixed it :)
     
Thread Status:
Not open for further replies.

Share This Page