Copy area between points to a location

Discussion in 'Plugin Development' started by CraterHater, Jan 10, 2017.

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

    CraterHater

    Hey there!

    I am creating a plugin that copies an area between two points to a certain location much like the vanilla /clone command. Anyone know how to do this. I know how to get all blocks between the two points but I have no idea how to paste them in correctly.

    Thanks!
     
  2. Offline

    Zombie_Striker

    @CraterHater
    1. Get the XYZ of the min location. (where the XYZ are all the lowest)
    2. Get the XYZ of the Max (All these values must be greater than the min values)
    3. Create three for loops. Each one will loop from a lowest value (Being XY or Z) and will loop until it reaches the highest.
    4. Use World.getBlockAt to get the block at each location. Store their durability types and material types somewhere. If you really need to be precises, store the blockstates as well. I would recommend using a hashmap to store them, the keys will be the locations of each block and the value will be all the values above.
     
Thread Status:
Not open for further replies.

Share This Page