end,\r
})\r
\r
+\r
+minetest.register_chatcommand("/spiral", {\r
+ params = "<size> <node>",\r
+ description = "Add Spiral at WorldEdit position 1 with size <size>, composed of <node>",\r
+ privs = {worldedit=true},\r
+ func = function(name, param)\r
+ local pos = worldedit.pos1[name]\r
+ if pos == nil then\r
+ minetest.chat_send_player(name, "No WorldEdit region selected")\r
+ return\r
+ end\r
+\r
+ local found, _, size, nodename = param:find("(%d+)%s+([^%s]+)$")\r
+ if found == nil then\r
+ minetest.chat_send_player(name, "Invalid usage: " .. param)\r
+ return\r
+ end\r
+ if not worldedit.node_is_valid(pos, nodename) then\r
+ minetest.chat_send_player(name, "Invalid node name: " .. param)\r
+ return\r
+ end\r
+\r
+ local count = worldedit.spiral(pos, tonumber(size), nodename)\r
+ minetest.chat_send_player(name, count .. " nodes changed")\r
+ end,\r
+})\r
+\r
minetest.register_chatcommand("/cylinder", {\r
params = "x/y/z/? <length> <radius> <node>",\r
description = "Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length> and radius <radius>, composed of <node>",\r
\r
minetest.chat_send_player(name, count .. " nodes loaded")\r
end,\r
-})
\ No newline at end of file
+})\r