//scale, //subdivide, //spop: use new position api

This commit is contained in:
Starbeamrainbowlabs 2023-07-02 02:02:42 +01:00
parent 9be7854297
commit 9b4a777a67
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 22 additions and 12 deletions

View file

@ -116,9 +116,11 @@ worldeditadditions_core.register_command("subdivide", {
end
worldedit.player_notify_suppress(name)
worldedit.pos1[name] = cpos1
worldedit.pos2[name] = cpos2
worldedit.marker_update(name)
wea_c.pos.set1(name, cpos1)
wea_c.pos.set2(name, cpos2)
-- worldedit.pos1[name] = cpos1
-- worldedit.pos2[name] = cpos2
-- worldedit.marker_update(name)
cmd.func(name, wea_c.table.unpack(cmd_args_parsed))
if will_trigger_saferegion(name, cmd_name, args) then
minetest.chatcommands["/y"].func(name)
@ -141,9 +143,12 @@ worldeditadditions_core.register_command("subdivide", {
time_last_msg = wea_c.get_ms_time()
end
end, function(_, _, stats)
worldedit.pos1[name] = pos1
worldedit.pos2[name] = pos2
worldedit.marker_update(name)
wea_c.pos.set1(name, pos1)
wea_c.pos.set2(name, pos2)
-- worldedit.pos1[name] = pos1
-- worldedit.pos2[name] = pos2
-- worldedit.marker_update(name)
-- Called on completion
minetest.log("action", string.format("%s used //subdivide at %s - %s, with %d chunks and %d total nodes in %s",

View file

@ -117,9 +117,11 @@ wea_c.register_command("scale", {
)
if not success then return success, stats end
worldedit.pos1[name] = stats.pos1
worldedit.pos2[name] = stats.pos2
worldedit.marker_update(name)
wea_c.pos.set1(name, stats.pos1)
wea_c.pos.set2(name, stats.pos2)
-- worldedit.pos1[name] = stats.pos1
-- worldedit.pos2[name] = stats.pos2
-- worldedit.marker_update(name)
local time_taken = wea_c.get_ms_time() - start_time

View file

@ -1,4 +1,5 @@
local wea = worldeditadditions
local weac = worldeditadditions_core
-- ███████ ██████ ██████ ██████
@ -20,9 +21,11 @@ worldeditadditions_core.register_command("spop", {
local success, pos1, pos2 = wea.spop(name)
if not success then return success, pos1 end
worldedit.pos1[name] = pos1
worldedit.pos2[name] = pos2
worldedit.marker_update(name)
weac.pos.set1(name, pos1)
weac.pos.set2(name, pos2)
-- worldedit.pos1[name] = pos1
-- worldedit.pos2[name] = pos2
-- worldedit.marker_update(name)
local new_count = wea.scount(name)
local plural = "s are"