Solved Clone worlds?

Discussion in 'Plugin Development' started by Rufus5, Jan 10, 2015.

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

    Rufus5

    Is there a way I can make bukkit generate an exact copy of a world for a minigame plugin?
     
  2. I'm not sure about the exact copy using the Bukkit API, but you could just copy the world folder from a location such as /plugins/YourPlugin/World or unload the minigame world and then copy it, renaming it to what you want, then loading it using Bukkit.createWorld("") (which'll load it if the world folder's present and working).

    Edit: Someone's probably going to reply to me saying that this could cause serious lag or whatever, I don't know, this is just a bad suggestion then. I've used it before and it's fine.
     
    Last edited: Jan 10, 2015
    Rufus5 likes this.
  3. Offline

    Rufus5

    Thank you!
     
    KingFaris11 likes this.
  4. By the way, when you copy it, make sure not to copy the session.lock file and uid.dat or something, it prevents you from creating a new world based on another world.
     
    xTrollxDudex likes this.
  5. Offline

    Krizeh

    @KingFaris11 oh gash KingFaris11 is bahk.
     
  6. Errr do I know you? But I'm not "back" back... just... checking notifs... ended up here...
     
  7. Offline

    Krizeh

    @KingFaris11 A long time ago, probably over a year ago I paid you to make a plugin. It was like Kohi's save kit plugin. You called it KrizehSigns or something. :p It's nice to see you're back (not back... back... Just checking notifs and such).
     
    KingFaris11 likes this.
  8. Offline

    Rufus5

    What can I use to get the world in plugins/myplugin/ ? I think Bukkit.getWorld will only target the server folder
     
  9. Code:
    File worldFile = new File(plugin.getDataFolder(), "World");
    getDataFolder() would return /plugin/PluginName/
    The ", "World"" would return /plugin/PluginName/World
     
    Rufus5 likes this.
  10. Offline

    Krizeh

    .getDataFolder()

    EDIT: He beat me to it ^
     
    Last edited: Jan 10, 2015
    Rufus5 and KingFaris11 like this.
  11. What? o.o I wrote that to him, not to you... (Your last edit) I was explaining it to him.
     
    Krizeh likes this.
  12. Offline

    Krizeh

    KingFaris11 likes this.
Thread Status:
Not open for further replies.

Share This Page