Help with Saving/Reading Files

Discussion in 'Plugin Development' started by Zero9195, May 28, 2011.

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

    Zero9195

    Hello guys,
    I'm at a point, where I want to save some things in a file and reload them if needed. I want to do this:
    Code:
    Locations:
        Loc1:
            World: publicworld
            X: -123
            Y: 70
            Z: 90
        Loc2:
            World: privateworld
            X: 64
            Y: 80
            Z: 90
    
    First of all, how shuld I do this? What should I use? Yaml just don't wanna get into my brain, and I'm frustrated trying to understand what other plugin authors did. it would be awesome if someone could give me a chunk of code and explain it to me. Thanks for Helping me!
    Zero

    Can noone help me? I really need this :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  2. Offline

    desht

    I just did this for my ScrollingMenuSign plugin, feel free to browse the source code on my github page (http://github.com/desht). Check out SMSPersistence.java in particular.
     
  3. Offline

    Zero9195

    @desht
    Thanks you! It helps me a lot, but I still can't find a way to save and load it. I just don't understand it. Could you try and write a short code where you save the things in my Example? Would be awesome! Thanks you ;)

    I finally made it thanks to this Tutorial here:
    http://forums.bukkit.org/threads/tutorial-create-a-configuration-file-with-yaml.15975/
    Thanks for helping me ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
Thread Status:
Not open for further replies.

Share This Page