Get the world folder.

Discussion in 'Plugin Development' started by azoundria, Jan 22, 2011.

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

    azoundria

    I'm building a town-based mod, and I would like to store the towns in a flat file system since that's the simplest to set up.

    I think it makes sense to store the data in the world folder, since presumable a server could have multiple possible worlds (say the current one and a backup) and you might want separate towns in each world. This way, each world can have their own stored towns.

    Does anyone know if there's a command build into Bukkit to fetch the folder name of the world? This is the one I set up in server.properties. (I would rather use this function than read server.properties myself, since I think that's more reliable and more efficient.)
     
  2. Offline

    MadMichi

    System.out.println(getServer().getWorlds()[0].getName());
    That should give you the name of the first world in the list of worlds.
    Or:
    System.out.println(getServer().getWorlds().toString());
    Hope it helps.
     
Thread Status:
Not open for further replies.

Share This Page