Copying and pasting large areas of land

Discussion in 'Plugin Development' started by Amgis, Oct 17, 2013.

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


    How does one copy and paste large areas of land quickly?
    I have been using the Block.setType() method to copy and paste land, block-by-block, but this is too slow and the server often crashes.
    I'm hoping to copy a 800x256x800 (x,y,z) block of land and paste it in an arbitrary location.
    No, I'm not going to use MCedit or some third-party plugin (WorldEdit, etc.) to do this.
  2. Offline


    WorldEdit does this very well. I know you said you didn't want to use it but not using it is basically just reinventing the wheel since it already does it well.
  3. Offline


    I saw a thread on this a while back which was fast and used NMS but I can't seem to find it :C.
    I'm not sure about quick but an idea I have would be saving the region to a file only storing 1 or 2 block data's in memory at a time then paste it into the new location loading the file using a buffer as not to have too much in ram at once also using a timer to pace it out a bit.
    This would be really slow but it wouldn't crash the server.
    The best and fastest way to do it is probably using worldedit though.
  4. Offline


    I can't use WorldEdit because I need a very specific non-square region to be copied to an arbitrary location on the map. It needs to happen every 24 hours and there needs to be a command that will force it to copy and paste as well.
  5. Offline


    Schedule a task to only change a few hundred blocks per tick. That will probably take care of the crashy problem.

    Edit: disregard a few hundred, make it thousands for such a large selection. A scheduled task is still the way to throttle how much cpu is used.

    If you change a measly 7000 blocks per tick (140,000 blocks per second) you can accomplish the task in a little under 20 minutes. (if I've done the math right)
    800 x 800 x 256 = 163,840,000 blocks

    I have never tried to worldedit anything close to that size. I think you will have to experiment a bit to find an acceptable time/performance ratio.
    tommycake50 likes this.
Thread Status:
Not open for further replies.

Share This Page