Solved Generate world from variable

Discussion in 'Plugin Development' started by Niv-Mizzet, Dec 1, 2019.

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

    Niv-Mizzet

    Hi there!
    This is probably a simple question with a simple fix, but I am not very good at plugin development.
    How do you generate a world from a world variable?
    I currently have this code:
    Code:
    public class VoidCreation{
    World test=Bukkit.getWorld("Void_Template");
    
    public VoidCreation(){
    }}
    How would I turn test into an actual server world?
    Thanks in advance!
     
  2. Offline

    yPedx

  3. Offline

    Niv-Mizzet

    @yPedx I looked there but I can't find anything that can generate a world from a variable, only a WorldCreator. Maybe somehow putting it in OnEnable()?
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Niv-Mizzet You can use the world name as name for the WorldCreator, then it will load that world.
     
  5. Offline

    yPedx

    Oh, I thought you meant generating a new world, not fetch an existing one.
     
  6. Offline

    Niv-Mizzet

    @timtower Thx, but I think you may have misread the question.
    What I want to do is:
    1. Create a world (Already done)
    2. Load it onto the server (Already done)
    3. Store this world in a world variable
    4. Create a COMPLETELY NEW world from that world variable, with a different name
    Thanks in advance.
     
  7. Offline

    timtower Administrator Administrator Moderator

    @Niv-Mizzet That is indeed something very different.
    You could copy chunks
     
  8. Offline

    Niv-Mizzet

    @timtower Thx!
    How would I go about doing that?
     
  9. Offline

    timtower Administrator Administrator Moderator

    Massive loop that could kill the server probably.
    Might be easier to restore a backup of the world.
     
  10. Offline

    Niv-Mizzet

    @timtower
    Thx!
    3 last questions:
    1. Would it be possible to unload the world, grab the world file, copy and rename that, then reload it?

    2. For simpler, one time things, would it be better to just copy and paste the world file in file explorer/finder, rename it, and then Multiverse core import it?

    3. Is there a bukkit feature request page, because I would really like to see a duplicate world method.
    Thanks!
     
  11. Offline

    timtower Administrator Administrator Moderator

    @Niv-Mizzet 1. I believe that you can.
    2. Results are the same as 1. But you can also do it on server start so that every time you restart the server (after a minigame) then you get a fresh world. No manual work needed.
    3. Spigot handles that. And I don't think that a duplicate world is a thing that would be implemented by the lack of usage.
     
  12. Offline

    Niv-Mizzet

Thread Status:
Not open for further replies.

Share This Page