From 277f3a815532831b489d93511dc58f11ded39719 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 10 Jul 2023 21:08:17 +0100 Subject: [PATCH] //move+: respect param2 Also update changelog --- CHANGELOG.md | 4 +++- worldeditadditions/lib/move.lua | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1702fce..2a6a7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,9 @@ Note to self: See the bottom of this file for the release template text. - Add [`//pos`](https://worldeditadditions.mooncarrot.space/Reference/#pos), for setting any numbered point (i.e. not just pos1 and pos2, but pos3 and beyond) - Add [`//spline`](https://worldeditadditions.mooncarrot.space/Reference/#spline), for drawing curved lines with an arbitrary number of points **(uses the new multi-point wand)** - Add [`//revolve`](https://worldeditadditions.mooncarrot.space/Reference/#revolve), which makes multiple evenly-spaced rotated copies of the defined region **(uses the new multi-point wand)** - - [`//copy+`](https://worldeditadditions.mooncarrot.space/Reference/#copy), [`//move+`](https://worldeditadditions.mooncarrot.space/Reference/#move): Added support for integrated `airapply` mode, which replaces nodes at the target only if they are air - append `airapply`/`aa` to the command to use + - [`//copy+`](https://worldeditadditions.mooncarrot.space/Reference/#copy), [`//move+`](https://worldeditadditions.mooncarrot.space/Reference/#move): + - Added support for integrated `airapply` mode, which replaces nodes at the target only if they are air - append `airapply`/`aa` to the command to use + - Respect node rotation (i.e. param2) when copying/moving ### Bugfixes and changes - Migrate from `depends.txt` to `mod.conf` diff --git a/worldeditadditions/lib/move.lua b/worldeditadditions/lib/move.lua index 0c46d50..845bba6 100644 --- a/worldeditadditions/lib/move.lua +++ b/worldeditadditions/lib/move.lua @@ -34,10 +34,12 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p -- Fetch the nodes in the source area local manip_source, area_source = worldedit.manip_helpers.init(source_pos1, source_pos2) local data_source = manip_source:get_data() + local data_source_param2 = manip_source:get_param2_data() -- Fetch a manip for the target area local manip_target, area_target = worldedit.manip_helpers.init(target_pos1, target_pos2) local data_target = manip_target:get_data() + local data_target_param2 = manip_target:get_param2_data() --- @@ -60,6 +62,7 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p end if should_replace then data_target[target_i] = data_source[source_i] + data_target_param2[target_i] = data_source_param2[source_i] total_placed = total_placed + 1 end end @@ -83,7 +86,7 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p --- -- 2: Save target --- - + manip_target:set_param2_data(data_target_param2) worldedit.manip_helpers.finish(manip_target, data_target) @@ -93,6 +96,7 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p manip_source, area_source = worldedit.manip_helpers.init(source_pos1, source_pos2) data_source = manip_source:get_data() + data_source_param2 = manip_source:get_param2_data() --- @@ -108,6 +112,7 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p if not source:is_contained(target_pos1, target_pos2) then data_source[source_i] = node_id_air + data_source_param2[source_i] = 0 end end end @@ -118,6 +123,7 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p -- 5: Save source --- + manip_source:set_param2_data(data_source_param2) worldedit.manip_helpers.finish(manip_source, data_source)