Solved Async World Creation

Discussion in 'Plugin Development' started by teej107, Jul 14, 2014.

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

    teej107

    1) I need a way to create a world off of the main thread or at least the best way to load a world causing the least amount of lag for the players. I know that the Bukkit methods needed to do this aren't thread safe and they would just cause an error when I try to create a world asynchronously. I have already tried that just to see what error pops up and it also ends up locking the server up. I have also done a fair bit of google searching, this being one of them: bukkit create world async. However the answers weren't that clear or there was no direct answer on how it can be achieved.

    2) Another option I would go for is using an API/Library. However I have failed to find one that allows async world creation. If anyone can point me to a link to one that would be great.

    3) If I decide to do none of the options above, I would just create the world when the plugin loads and just copy it before I am going to use it. (because I don't want to edit the world directly, I want to keep an unused copy). Is this the best way to do it this way?

    Now I know there is a way to do any of these options. I have seen some servers that tell you when a world is being generated however I don't know what methods they use to achieve this. Any help on this would be greatly appreciated.

    EDIT: All of this needs to be done without restarting the server. Reloading the plugins though is still fine.
     
  2. Offline

    ResultStatic

    teej107 i dont think there ever will be a way to create worlds async. the best way is to have 2 servers connected with a "rubber band like thing". you could have intense calculation done on other threads i think, but thats about it.
     
  3. Offline

    teej107

    ResultStatic I am not going to use a "rubber band like thing". If you think the first 2 options are not possible, can I get your opinion on the third option? I don't need code, I just want to get your opinion on if that is a good way of doing it.
     
  4. Offline

    ResultStatic

    teej107 i made a hunger games plugin one day that restarted the server and deleted the old world and created a new one on load.
     
  5. Offline

    teej107

    ResultStatic Maybe I need to include more details. I have put in an edit in the OP.
    Do you think my 3rd option is the best way? The worlds do not need to have a different seed. This could be done asynchronously but I don't know if I will run into issues since it is a straight copy of a world folder and all of its contents. Maybe it is time for me to do some testing.
     
Thread Status:
Not open for further replies.

Share This Page