Regenerate an area marked by a Cuboid?

Discussion in 'Spigot Plugin Development' started by Brunno, May 27, 2016.

  1. On my server there is an area (a forest) that players can harvest timber, and I wonder if, marking this area in a cuboid, is there any way to "regenerate" this area (like "// undo" of WorldEdit) after a certain period of time, with a ScheduledTask.
    Would I like to regenerate the area identically to the form of start.
    Can you help me?

    Sorry for the bad English, I'm using Google translator to translate this message

  2. Without using some sort of external API, you could make a 3D array and store loop through your cuboid saving each block. After a certain period of time, you loop through the same cuboid replacing all the blocks with the blocks that were stored in the array.
  3. This command is possible in console?
  4. It's a worldedit command, so no.
  5. Then why did you offer it as a solution?

    You can select and save the blocks' original states, and update them in the task whenever it is executed.
  6. It's a world edit command, he can look at the code and see how they do it in world edit
  7. Very Easy:
    1. Save you area somehow into a file, block for block. For Example in a YML, X to Y to Z
    2. Create a Scheduled Task (you should know how it works)
    3. Like #1, but the opposite --> Just place the blocks which you have saved
    To make better performance, you should not save the void-blocks (0) and check if the block in the world is just the same as the block which is saved, if yes don't replace ;)

  8. YESS, I will view it :)