diff --git a/worldeditadditions/lib/move.lua b/worldeditadditions/lib/move.lua index d0963aa..63586f1 100644 --- a/worldeditadditions/lib/move.lua +++ b/worldeditadditions/lib/move.lua @@ -37,8 +37,8 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p local target = source:subtract(offset) local target_i = area_target:index(target.x, target.y, target.z) - data_source[source_i] = node_id_air data_target[target_i] = data_source[source_i] + data_source[source_i] = node_id_air end end end diff --git a/worldeditadditions_commands/commands/move.lua b/worldeditadditions_commands/commands/move.lua index 7391526..8856d2f 100644 --- a/worldeditadditions_commands/commands/move.lua +++ b/worldeditadditions_commands/commands/move.lua @@ -45,18 +45,28 @@ worldedit.register_command("move+", { -- TODO: Make this an override local success_a, copy_offset = parse_stage2(name, parts) if not success_a then return success_a, copy_offset end + --- 1: Calculate the source & target regions + ----------------------------------------------------------------------- local source_pos1 = Vector3.clone(worldedit.pos1[name]) local source_pos2 = Vector3.clone(worldedit.pos2[name]) local target_pos1 = source_pos1 + copy_offset local target_pos2 = source_pos2 + copy_offset + -- 2: Move the nodes + ----------------------------------------------------------------------- local success_b, nodes_modified = wea.move( source_pos1, source_pos2, target_pos1, target_pos2 ) if not success_b then return success_b, nodes_modified end + -- 3: Update the defined region + ----------------------------------------------------------------------- + worldedit.pos1[name] = target_pos1 + worldedit.pos2[name] = target_pos2 + worldedit.marker_update(name) + local time_taken = wea.get_ms_time() - start_time