[SOLVED] "Worlds" file gets reseted when enableing the plugin.

Discussion in 'Plugin Development' started by EdenCampo, Nov 3, 2011.

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

    EdenCampo

    Hello there,

    -snip-

    Thanks!

    -snip-

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

    RROD

    I don't know, but you have really bad grammar.
     
  3. Offline

    EdenCampo

    I'm from Israel, I know my grammar is bad.
    That's what you care about?
    -.-
     
  4. Offline

    undeadmach1ne

    wow good one :rolleyes:

    as for the problem, try to saveConfig(); on the file when you make a change to it, or maybe in your onDisable...or both :)
     
  5. Offline

    EdenCampo

    I've got errors from the saveConfig();
    Anyways I solved the problem.

    Thanks for the help :D
     
  6. Offline

    undeadmach1ne

    thats strange. i wonder why it gave you errors. that works fine for me...but my plugins config is pretty basic. how did you fix it anyway? could be useful for other people searching the forum for the same problem.
     
  7. Offline

    EdenCampo

    Well, I don't use bukkit's configuration, Maybe that caused the problem.

    Any ways, I used

    Code:
    public void onLoad() {
    Bukkit.getServer().getScheduler().scheduleAsyncDelayedTask(this, new Runnable() {
                public void run() {
                    createConfig();
                    createHData();
                    createWorlds();
                    createInventoryFile();
                        GamemodeChangerWorldListener.class.getClassLoader();
                }
        }, 10l);
    }
    That helped somehow :p
     
  8. Offline

    undeadmach1ne

    nice =) i guess maybe saveConfig only works for the the default config.yml? im a bit of a noob still so i dont really get some things lol. thanks for posting your findings.
     
  9. Offline

    EdenCampo

    No problem, If you want help, I'm here :D
     
    undeadmach1ne likes this.
Thread Status:
Not open for further replies.

Share This Page