axis, sign = worldedit.player_axis(name)\r
repetitions = repetitions * sign\r
end\r
- local count = worldedit.stack(worldedit.pos1[name], worldedit.pos2[name], axis, repetitions)\r
- worldedit.player_notify(name, count .. " nodes stacked")\r
+\r
+ local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]\r
+ local count = worldedit.volume(pos1, pos2) * math.abs(repetitions)\r
+ worldedit.stack(pos1, pos2, axis, repetitions, function()\r
+ worldedit.player_notify(name, count .. " nodes stacked")\r
+ end)\r
end,\r
function(name, param)\r
local found, _, axis, repetitions = param:find("^([xyz%?])%s+([+-]?%d+)$")\r
worldedit.player_notify(name, "invalid usage: " .. param)\r
return\r
end\r
+\r
local count = check_region(name, param)\r
- if count then return (tonumber(repetitions) + 1) * count end\r
+ if count then return tonumber(repetitions) * count end\r
return nil\r
end),\r
})\r
params = "<count> <x> <y> <z>",\r
description = "Stack the current WorldEdit region <count> times by offset <x>, <y>, <z>",\r
privs = {worldedit=true},\r
- func = function(name, param)\r
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]\r
- if pos1 == nil or pos2 == nil then\r
- worldedit.player_notify(name, "Select a position first!")\r
- return\r
- end\r
+ func = safe_region(function(name, param)\r
local repetitions, incs = param:match("(%d+)%s*(.+)")\r
if repetitions == nil then\r
- worldedit.player_notify(name, "invalid count: " .. param)\r
return\r
end\r
repetitions = tonumber(repetitions)\r
end\r
x, y, z = tonumber(x), tonumber(y), tonumber(z)\r
\r
+ local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]\r
local count = worldedit.volume(pos1, pos2) * repetitions\r
+ worldedit.stack2(pos1, pos2, {x=x, y=y, z=z}, repetitions, function()\r
+ worldedit.player_notify(name, count .. " nodes stacked")\r
+ end)\r
+ end,\r
+ function(name, param)\r
+ local repetitions, incs = param:match("(%d+)%s*(.+)")\r
+ if repetitions == nil then\r
+ worldedit.player_notify(name, "invalid count: " .. param)\r
+ return\r
+ end\r
+ repetitions = tonumber(repetitions)\r
\r
- return safe_region(function()\r
- worldedit.stack2(pos1, pos2, {x=x, y=y, z=z}, repetitions,\r
- function() worldedit.player_notify(name, count .. " nodes stacked") end)\r
- end, function()\r
- return count\r
- end)(name,param) -- more hax --wip: clean this up a little bit\r
- end\r
+ local count = check_region(name, param)\r
+ if count then return repetitions * count end\r
+ return nil\r
+ end),\r
})\r
\r
\r