WorldConlictException?!

Discussion in 'Plugin Development' started by iMint, Jun 25, 2012.

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

    iMint

    Hi guys.

    I'm working on a plugin of mine, and I've created a class to duplicate worlds. However, after the world folder is duplicated and I've loaded the world, it prepares the spawn region then spams the following error in the console:

    17:47:12 [SEVERE] net.minecraft.server.WorldConlictException: The save is being
    accessed from another location, aborting

    Players also get disconnected. I don't know whats causing this, but its a huge problem.
    Here is my code:

    CmdExecutor: http://pastie.org/4150856
    WorldGenerator: http://pastie.org/4150855
     
  2. you cant load a world more than 1 time, like you cant open the same word file 2 times
     
  3. Offline

    CorrieKay

    wait...

    what..?
     
    iMint likes this.
  4. Offline

    Dreeass

    You have to unload the world I think before copying it, but I'm not sure because this exception means that the world is getting used and you're trying to edit the folder. Like you were editing a file while it's opened in a program.
     
  5. Offline

    iMint

    That includes loading the same map from a different folder? I'm 99% sure that a different folder = a different world.

    I'm pretty sure I'm not loading the same world twice... Its the same map, but i've created a different folder for the duplicate. I'm not loading the same world, i'm copying it and loading the copy alongside it.

    Ah, that makes sense. How do I unload a world?

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

    hammale

    i think its getServer().unloadWorld(world, save); the world can be either a string or a World and the save is a boolean.
     
    iMint likes this.
  7. Offline

    iMint

    Fixed! Thanks a bunch guys.
     
    hammale likes this.
  8. Offline

    hammale

    glad to hear it :D
     
  9. Offline

    caldabeast

    What is that eclipse scheme you are using? I like

    (That wasn't off topic at all)
     
  10. minecraft also open it for writing, you know what will happends when 2 programs try to write at the same file 20 times a ssecond each, no, you cant predict that, minecraft is throwing that exception to indicate that that is hapening

    back on topic, minecraft throws that exception when session.lock chances while the world is openen, as he creates the world before he copies the files, it is chanced (dont know if thiis is already said)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
    LucasEmanuel likes this.
  11. Offline

    LucasEmanuel

    This could be compared to non thread safe data manipulation :)
     
    ferrybig likes this.
Thread Status:
Not open for further replies.

Share This Page