From 3c61759bae15d8bedc9c54b4e3903479a5f4cf08 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 5 Sep 2017 14:40:46 +0200 Subject: Allow to bulk-set param2 of regions (#144) --- worldedit_commands/init.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'worldedit_commands/init.lua') diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 897636c..1ab8c19 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -408,6 +408,25 @@ minetest.register_chatcommand("/set", { end, check_region), }) +minetest.register_chatcommand("/param2", { + params = "", + description = "Set param2 of all nodes in the current WorldEdit region to ", + privs = {worldedit=true}, + func = safe_region(function(name, param) + local param2 = tonumber(param) + if not param2 then + worldedit.player_notify(name, "Invalid or missing param2 argument") + return + elseif param2 < 0 or param2 > 255 then + worldedit.player_notify(name, "Param2 is out of range (must be between 0 and 255 inclusive)!") + return + end + + local count = worldedit.set_param2(worldedit.pos1[name], worldedit.pos2[name], param2) + worldedit.player_notify(name, count .. " nodes altered") + end, check_region), +}) + minetest.register_chatcommand("/mix", { params = " ...", description = "Fill the current WorldEdit region with a random mix of , ...", -- cgit v1.2.3