Solved Resetting Custom Land

Discussion in 'Plugin Development' started by macboinc, Jun 12, 2014.

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

    macboinc

    Hello!
    I am making a minigame plugin where there is gonna be a lot of destruction. How would I program this so at the end of the game? It resets the arena? I know this is possible because I see it on a whole bunch of different servers. Help?!?!
     
  2. Offline

    Mrawesomecookie

    macboinc
    Store the chunks then delete them and replace them?
     
  3. For my mini-games, I just disable people from going into the world at the end of the game (a static variable called worldResetting and listening to the world change event), then unloading and deleting the world, then copying and pasting it back from a folder (For mine I use /plugins/<plugin>/Worlds/<world>) into the main server directory/world container (Bukkit.getWorldContainer() or something) and setting worldResetting back to false.
     
  4. Offline

    macboinc

    Ok, I will try this, but won't that lag the server?
     
  5. It'll pause the main server thread to load the world, but deleting the world and copying/pasting happens almost instantly on average servers, even normal servers hosted on PytoHost, etc. I use this method on a dedicated server therefore meaning the server is dedicated to me only, so it is fast.
     
  6. Offline

    macboinc

    Ok!
     
  7. Offline

    xTrollxDudex

    Might as well do it async
     
  8. Offline

    macboinc

    Would you paste some code on how to do this? (I am new to world editing/coding)

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page