Solved Undo changes in world

Discussion in 'Plugin Development' started by Reinified, May 19, 2018.

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

    Reinified

    Alright, so. I'm making a spleef plugin but I can't seem to figure this out. I've got the world with the map, but I want to reset it (to it's pre-game state) after each game. How could this be done?

    My best guess is that you should have another world with a backup of the unchanged map, and then replace the new map with the backup. Tips?
     
  2. Online

    timtower Moderator Moderator

  3. Offline

    Reinified

    @timtower as in? I know world edit includes schematics of that's what you mean.
     
  4. Online

    timtower Moderator Moderator

    @Reinified Those could work.
    Or having a separate arena on a fixed location that you can copy and paste.
     
  5. This is possibly not the most efficient way, but I listen to any events that could change a block (BlockBreakEvent, BlockPlaceEvent, etc) and add its BlockState before the modification to a List. When the game ends, iterate across the list and update all of the BlockStates (may want to do it in waves to avoid lag)
    Hope this helps

    Sent from my SM-G903F using Tapatalk
     
  6. Offline

    Reinified

    @TheMinecraftKnight
    Hey, thanks for the reply. I'll try that since it seems relatively simple and speed isn't really an issue right now.
    Thanks to both of you for your helpful replies!
     
Thread Status:
Not open for further replies.

Share This Page