//move+: respect param2

Also update changelog
This commit is contained in:
Starbeamrainbowlabs 2023-07-10 21:08:17 +01:00
parent d63400e697
commit 277f3a8155
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 10 additions and 2 deletions

View file

@ -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 [`//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 [`//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)** - 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 ### Bugfixes and changes
- Migrate from `depends.txt` to `mod.conf` - Migrate from `depends.txt` to `mod.conf`

View file

@ -34,10 +34,12 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p
-- Fetch the nodes in the source area -- Fetch the nodes in the source area
local manip_source, area_source = worldedit.manip_helpers.init(source_pos1, source_pos2) local manip_source, area_source = worldedit.manip_helpers.init(source_pos1, source_pos2)
local data_source = manip_source:get_data() local data_source = manip_source:get_data()
local data_source_param2 = manip_source:get_param2_data()
-- Fetch a manip for the target area -- Fetch a manip for the target area
local manip_target, area_target = worldedit.manip_helpers.init(target_pos1, target_pos2) local manip_target, area_target = worldedit.manip_helpers.init(target_pos1, target_pos2)
local data_target = manip_target:get_data() 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 end
if should_replace then if should_replace then
data_target[target_i] = data_source[source_i] data_target[target_i] = data_source[source_i]
data_target_param2[target_i] = data_source_param2[source_i]
total_placed = total_placed + 1 total_placed = total_placed + 1
end end
end end
@ -83,7 +86,7 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p
--- ---
-- 2: Save target -- 2: Save target
--- ---
manip_target:set_param2_data(data_target_param2)
worldedit.manip_helpers.finish(manip_target, data_target) 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) manip_source, area_source = worldedit.manip_helpers.init(source_pos1, source_pos2)
data_source = manip_source:get_data() 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 if not source:is_contained(target_pos1, target_pos2) then
data_source[source_i] = node_id_air data_source[source_i] = node_id_air
data_source_param2[source_i] = 0
end end
end end
end end
@ -118,6 +123,7 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p
-- 5: Save source -- 5: Save source
--- ---
manip_source:set_param2_data(data_source_param2)
worldedit.manip_helpers.finish(manip_source, data_source) worldedit.manip_helpers.finish(manip_source, data_source)