saveConfig()

Discussion in 'Plugin Development' started by thefiscster510, Jan 2, 2013.

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

    thefiscster510

    Hi. I'm working on a plugin for an old friend. he runs a nostalgic minecraft server, where the server is running craftbukki-0.0.1 and the clients all run mc beta 1.7.. So, I'm making him a plugin using the old bukkit api (0.0.1). And i can't seem to figure out how to do saveConfig();.. I did find, getConfiguration().save(); but that doesn't seem to work.. it just leaves the whole file empty..
     
  2. Offline

    tommycake50

    save it yourself?
    don't you know how to handle files?
     
  3. Offline

    thefiscster510

    Herp derp. I know that. But when i do something like, getConfiguration().setProperty("something.enabled", true); I need to be able to save the changes.. and i don't know how back then :3
     
  4. Offline

    tommycake50

    config.save(String path);
    path being plugins/pluginname/config.yml
     
  5. Offline

    thefiscster510

    =
    Have you done much with the old api..? They don't have the org.bukkit.configuration.file.FileConfiguration object that you're looking at the method save(String path) from.. the old api, uses a Configuration object, and only has the method save() with no constructors.. I need to figure out how to use the config.save(String file) with the old api.. As far as i've found, there are no methods for this.. So, I'm asking if anyone else knows how.. (They must have known how, because they used to do it..)
     
  6. Offline

    tommycake50

    actually i added the last 0.0.1 snapshot they made to my list of libraries on fresh project just to test that.
    and it does.
    i don't know why it doesnt 4 u.
    you can try and get every element in at and write it with that element.toString() to a file.
     
  7. Offline

    thefiscster510

    I'm sorry, I made a mistake.. It's not 0-0-1.. Here is my initialization line:
    19:14:13 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-945-g73697a4-b1000jnks (MC: 1.7.3)
     
  8. Offline

    tommycake50

    how do you get that build?
     
  9. Offline

    fireblast709

  10. Offline

    tommycake50

  11. Offline

    fireblast709

    well that is the oldest they offer :3
     
  12. Offline

    boardinggamer

    try adding getConfiguration.options.copyDefaults(ture); to it and see if that works
     
  13. Offline

    Junnesejer

    I must quote:
    "They don't have the org.bukkit.configuration.file.FileConfiguration object that you're looking at the method save(String path) from.. the old api, uses a Configuration object, and only has the method save() with no constructors.."

    Please read before posting, lol.
     
    thefiscster510 likes this.
  14. Offline

    thefiscster510

    The bukkit file is craftbukkit-0.0.1-SNAPSHOT.jar
    But when i start the server, I get
    19:14:13 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-945-g73697a4-b1000jnks (MC: 1.7.3)

    If anyone would like my jar to work with, I can supply it..
    http://www.fiscalleti.com/downloads/craftbukkit-0.0.1-SNAPSHOT.jar

    They do not have the options().copyDefaults(true); and that's not what i'm needing anyway. I need to save changes that i've made to an existing configuration...
     
  15. Offline

    Junnesejer

    Could you try:
    Code:
    saveDefaultConfig();
    I'm really interested if it works, but I guess it won't.
     
  16. Offline

    thefiscster510

    Nope, That's not a method.
     
  17. Offline

    fireblast709

    org.bukkit.util.config.Configuration has a boolean save() method

    [source] the jd-gui decompiler + CB 0.0.1
     
  18. Offline

    thefiscster510

    I tried doing getConfiguration().save() already, and it doesn't work right.. It saves the value i changed, but it screws up the rest of the file..
     
  19. Offline

    boardinggamer

    Well I am new with configs so I was just trying. my bad, now I know =P
     
  20. Offline

    fireblast709

    Its not about being new. The OP wants to create a plugin for one of the first releases of CB. Alot changed ever since
     
  21. Offline

    tommycake50

    what about using an updated version of the yaml library?
     
  22. Offline

    Junnesejer

    tommycake50 Possible, I think I'd rather use an external lib for this.
     
  23. Offline

    thefiscster510

    They did it before back when this was the only api they had, I'd just like to know how they did it.. I'd prefer to stray away from any unnecessary libs.
     
  24. Offline

    fireblast709

    You could include the files they have now
     
  25. Offline

    thefiscster510

    I'm not making a custom bukkit.. And I already said, I don't want to add bulk to my plugin.. I'd just like to know how they did it back in the day..
     
Thread Status:
Not open for further replies.

Share This Page