Roling back an area

Discussion in 'Plugin Development' started by john01dav, Jan 10, 2014.

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

    john01dav

    Hello all, I am working on a mini-game plugin that when players are playing the game the arena gets griefed (the players destroy each other's sides in order to win). But, when it is done I want the arena to reset. The arena is in it's own world, loaded by multiverse (I cannot use multiworld as I need more than 10 worlds), so unloading then copying and reloading is not an option. I cannot restart the server to copy/reload the world either as this server is 24/7 (restarts every 10 minutes when the arena resets are just unthinkable). I attempted to get the prism and coreprotect apis working to do this but they just decided that they would refuse to work. Thank you in advance for any suggestions :)
     
  2. Offline

    jthort

    john01dav I know this is sort of an old post, but whatever. You can create a for loop that stores all the blocks and locations in a hashmap, then create another for loop to place them again. I don't know if it's the most efficient way but it works. If anyone else knows a better way I would be interested in hearing it
     
  3. Offline

    jusjus112

    john01dav
    You can make an isIngame(); method, then use an blockbreakevent then if the player is ingame cancel the event!
    If you will that not every arena is cancelled! then get the aren you want it!
    then gets the arena, and rollback him.
    you can use for that, an loop for all arenas, and if an block is changed, rollback him!
     
  4. Offline

    john01dav

    OK, I happened to find a better solution. I will post it here just so others may access it. All you need to do is load a world (without multiverse/multiworld/etc), set autosave to false, then to reset it just unload then reload it.
     
Thread Status:
Not open for further replies.

Share This Page