+ local dim = vector.add(vector.subtract(pos2, pos1), 1)\r
+ if math.abs(amount) < dim[axis] then\r
+ -- Source and destination region are overlapping\r
+ -- FIXME: I can't be bothered, so just defer to the legacy code for now.\r
+ return worldedit.legacy_move(pos1, pos2, axis, amount)\r
+ end\r
+\r
+ -- Copy stuff to new location\r
+ local off = {x=0, y=0, z=0}\r
+ off[axis] = amount\r
+ worldedit.copy2(pos1, pos2, off)\r
+ -- Nuke old area\r
+ worldedit.set(pos1, pos2, "air")\r
+\r
+ return worldedit.volume(pos1, pos2)\r
+end\r
+\r
+-- This function is not offical part of the API and may be removed at any time.\r
+function worldedit.legacy_move(pos1, pos2, axis, amount)\r
+ local pos1, pos2 = worldedit.sort_pos(pos1, pos2)\r
+\r