Saving and restoring an area

Discussion in 'Plugin Development' started by woutwoot, Jun 21, 2013.

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

    woutwoot

    Hello,

    I'm working on a new minecraft game that works with an arena. I'm working on everything, and it's working nicely. But right now I'm sort of stuck. I need a way of selecting an area (Like with worldedit, a cuboid) and the plugin has to save it somewhere. After the game is finished, the arena has to be restored, without causing to much lag. Does anyone know a good way of doing this? If yes, can you give me an example?

    Thanks for your help :)
     
  2. Offline

    foodyling

    As long as the server doesn't get shut off in between, you can capture the BlockState of each block and .update() them.
    List<BlockState> Blocks = new ArrayList<BlockState>();
    for (Block block : /* Insert List of Blocks Needed */) {
    Blocks.add(block.getState());
    }

    Later on:
    for (Block block : Blocks) {
    Blocks.update();
    }
     
  3. Offline

    woutwoot

    I see, will try! This does not cover selection though, but I might be able to get that working myself. (not good at math though :p):) Will this also save chest contents?
     
Thread Status:
Not open for further replies.

Share This Page