Restore map without restart

Discussion in 'Plugin Development' started by dram, Apr 27, 2015.

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

    dram

    Hello.

    I'm in trouble.

    Lets see a situation:
    We have a world map. Player connect to server and do something on map for example cut trees, grass...
    After X time I want to restore all changes to main map (without server restart)


    Have You any idea ?
     
  2. What I use to reset maps for stuff like minigames, is teleport everyone to a different world, and then unload the main world with Bukkit.unloadWorld(<world>, false) so it doesn't save the changes, and then load the world again with your preferences and then tp them back there.
     
    dram likes this.
  3. Offline

    RainoBoy97

    You have three options:
    1. The above
    2. Teleport all players to a different world, unload and delete the previous, then copy over and create the new one
    3. Schematics
     
    dram likes this.
  4. Offline

    dram

    Hmm the best option is @megamichiel I think.

    But @RainoBoy97 could you tell me about Schematics? What is this?
     
  5. Offline

    ark9026

    @dram
    Another option: You can get the blocks clicked, store them in an arraylist, and restore them whenever you want.
    Third option: You can get the blocks clicked, create a runnable, and restore the blocks in the time defined

    Also note: No players need to be moved to a different world for these methods
     
    dram and sgavster like this.
  6. Offline

    mythbusterma

    @ark9026

    You know, a Set or LinkedList is a lot better for this than ArrayList.
     
    Konato_K and ark9026 like this.
  7. Offline

    ark9026

    @mythbusterma
    Good point, but for this a runnable would probably be the easiest option.

    @dram
    If anything above solved your problem, be sure to put the [Solved] tag at the top
     
    Last edited by a moderator: Apr 27, 2015
  8. Offline

    RainoBoy97

    But you would still need a list of some sort. Because creating a runnable for each block broken is just... no.
     
  9. Offline

    ark9026

    I didn't say it would be the most efficient, but it certainly would work.
     
Thread Status:
Not open for further replies.

Share This Page