Solved Config.yml line breaks

Discussion in 'Plugin Development' started by MightyOne, Aug 13, 2017.

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

    MightyOne

    Hello,
    this topic had already been discussed several times but the solutions could not help me anyway:
    In my latest plugin I use a config.yml. To restore lost data in it I also have a default config file in the jar itself.
    After reloading the server with the plugin the config.yml (not the default one) is written in only one line. Other peolpe said adding /n or | would create a new line wherever I want. So I tried to put some in the default config but the result was the same after reloading. One endless line in the config just with some useless /n and | in it.
    So my questions are: How do I create line break in a config.yml? Or where exactly do I insert /n?

    Thanks for any help.
     
  2. Offline

    PenguinOwl

    This doesn't directly answer you question, but I throw my config.yml into my src folder and save it with getConfig().saveDefaultConfig()
     
  3. Offline

    timtower Administrator Administrator Moderator

    @MightyOne Please give an example of what you want, what kind of message are we talking about?
     
  4. Offline

    MightyOne

    @timtower So in my hnd written default config.yml I have a header:
    Code:
    # *pluginName*'s configuration file
    # About editing this file:
    # It is recommended to use the commands ingame for editing.
    # Changing some wrong values will cause awkward stuff. 
    But when I open the file created by the server it just looks like:
    Code:
    # *pluginName*'s configuration file # About editing this file: # It is recommended to use the commands ingame instead of changing values here manuelly. # Using the some wrong values will cause awkward stuff.
    Other configs like the one from WorldEdit have line breaks anyway :(
     
    Last edited: Aug 14, 2017
  5. Offline

    timtower Administrator Administrator Moderator

    @MightyOne Use Notepad++ to open the files, your editor just isn't compatible with the line endings.
     
    MightyOne likes this.
  6. Offline

    MightyOne

    @timtower currently I am just jusing Eclipse to code n stuff. I will have a look
     
  7. Offline

    PenguinOwl

    Do you have the YEdit plugin in your eclipse workspace?
     
  8. Offline

    MightyOne

    @PenguinOwl no I dont. I guess I will try to download this first.
     
  9. Offline

    PenguinOwl

    That should fix your problem, eclipse can't handle yml files well on its own.
     
Thread Status:
Not open for further replies.

Share This Page