/** * 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())); } } } }
/** * 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]); } } } }