示例#1
0
 /**
  * Copy to the clipboard.
  *
  * @param editSession
  */
 public void copy(EditSession editSession) {
   for (int x = 0; x < size.getBlockX(); ++x) {
     for (int y = 0; y < size.getBlockY(); ++y) {
       for (int z = 0; z < size.getBlockZ(); ++z) {
         data[x][y][z] = editSession.getBlock(new Vector(x, y, z).add(getOrigin()));
       }
     }
   }
 }
示例#2
0
  /**
   * Places the blocks in a position from the minimum corner.
   *
   * @param editSession
   * @param pos
   * @param noAir
   * @throws MaxChangedBlocksException
   */
  public void place(EditSession editSession, Vector pos, boolean noAir)
      throws MaxChangedBlocksException {
    for (int x = 0; x < size.getBlockX(); ++x) {
      for (int y = 0; y < size.getBlockY(); ++y) {
        for (int z = 0; z < size.getBlockZ(); ++z) {
          if (noAir && data[x][y][z].isAir()) {
            continue;
          }

          editSession.setBlock(new Vector(x, y, z).add(pos), data[x][y][z]);
        }
      }
    }
  }