]> git.lizzy.rs Git - worldedit.git/commitdiff
Support descriptions and partial node names in chat commands (e.g., `//set blue light...
authorAnthony Zhang <azhang9@gmail.com>
Wed, 12 Jun 2013 23:59:13 +0000 (19:59 -0400)
committerAnthony Zhang <azhang9@gmail.com>
Wed, 12 Jun 2013 23:59:13 +0000 (19:59 -0400)
Chat Commands.md
README.md
worldedit_commands/init.lua

index b3d8cfae1a08279251b2af23515edac55bd05a15..4b395269a40ca89e57dc6ce82377fcee2f84e406 100644 (file)
@@ -51,93 +51,93 @@ Display the volume of the current WorldEdit region.
 \r
 Set the current WorldEdit region to <node>.\r
 \r
-    //set dirt\r
-    //set default:glass\r
-    //set mesecons:mesecon\r
+    //set cactus\r
+    //set Bronze Block\r
+    //set mesecons:wire_00000000_off\r
 \r
 ### //replace <search node> <replace node>\r
 \r
 Replace all instances of <search node> with <replace node> in the current WorldEdit region.\r
 \r
-    //replace cobble stone\r
-    //replace default:steelblock glass\r
-    //replace dirt flowers:flower_waterlily\r
-    //replace flowers:flower_rose flowers:flower_tulip\r
+    //replace Cobblestone cactus\r
+    //replace lightstone_blue glass\r
+    //replace dirt Bronze Block\r
+    //replace mesecons:wire_00000000_off flowers:flower_tulip\r
 \r
 ### //replaceinverse <search node> <replace node>\r
 \r
 Replace all nodes other than <search node> with <replace node> in the current WorldEdit region.\r
 \r
-    //replaceinverse air stone\r
-    //replaceinverse water_source default:dirt\r
-    //replaceinverse mesecons:mesecon air\r
-    //replaceinverse default:steelblock default:glass\r
+    //replaceinverse Cobblestone cactus\r
+    //replaceinverse flowers:flower_waterlily glass\r
+    //replaceinverse dirt Bronze Block\r
+    //replaceinverse mesecons:wire_00000000_off flowers:flower_tulip\r
 \r
 ### //hollowsphere <radius> <node>\r
 \r
 Add hollow sphere at WorldEdit position 1 with radius <radius>, composed of <node>.\r
 \r
-    //hollowsphere 5 dirt\r
-    //hollowsphere 12 default:glass\r
-    //hollowsphere 17 mesecons:mesecon\r
+    //hollowsphere 5 Diamond Block\r
+    //hollowsphere 12 glass\r
+    //hollowsphere 17 mesecons:wire_00000000_off\r
 \r
 ### //sphere <radius> <node>\r
 \r
 Add sphere at WorldEdit position 1 with radius <radius>, composed of <node>.\r
 \r
-    //sphere 5 dirt\r
-    //sphere 12 default:glass\r
-    //sphere 17 mesecons:mesecon\r
+    //sphere 5 Diamond Block\r
+    //sphere 12 glass\r
+    //sphere 17 mesecons:wire_00000000_off\r
 \r
 ### //hollowdome <radius> <node>\r
 \r
 Add hollow dome at WorldEdit position 1 with radius <radius>, composed of <node>.\r
 \r
-    //hollowdome 5 dirt\r
-    //hollowdome 12 default:glass\r
-    //hollowdome 17 mesecons:mesecon\r
+    //hollowdome 5 Diamond Block\r
+    //hollowdome 12 glass\r
+    //hollowdome 17 mesecons:wire_00000000_off\r
 \r
 ### //dome <radius> <node>\r
 \r
 Add dome at WorldEdit position 1 with radius <radius>, composed of <node>.\r
 \r
-    //dome 5 dirt\r
-    //dome 12 default:glass\r
-    //dome 17 mesecons:mesecon\r
+    //dome 5 Diamond Block\r
+    //dome 12 glass\r
+    //dome 17 mesecons:wire_00000000_off\r
 \r
 ### //hollowcylinder x/y/z/? <length> <radius> <node>\r
 \r
 Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length> and radius <radius>, composed of <node>.\r
 \r
-    //hollowcylinder x +5 8 dirt\r
-    //hollowcylinder y 28 10 default:glass\r
-    //hollowcylinder z -12 3 mesecons:mesecon\r
-    //hollowcylinder ? 2 4 stone\r
+    //hollowcylinder x +5 8 Bronze Block\r
+    //hollowcylinder y 28 10 glass\r
+    //hollowcylinder z -12 3 mesecons:wire_00000000_off\r
+    //hollowcylinder ? 2 4 default:stone\r
 \r
 ### //cylinder x/y/z/? <length> <radius> <node>\r
 \r
 Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length> and radius <radius>, composed of <node>.\r
 \r
-    //cylinder x +5 8 dirt\r
-    //cylinder y 28 10 default:glass\r
-    //cylinder z -12 3 mesecons:mesecon\r
-    //cylinder ? 2 4 stone\r
+    //cylinder x +5 8 Bronze Block\r
+    //cylinder y 28 10 glass\r
+    //cylinder z -12 3 mesecons:wire_00000000_off\r
+    //cylinder ? 2 4 default:stone\r
     \r
 ### //pyramid <height> <node>\r
 \r
 Add pyramid at WorldEdit position 1 with height <height>, composed of <node>.\r
 \r
-    //pyramid 8 dirt\r
-    //pyramid 5 default:glass\r
-    //pyramid 2 stone\r
+    //pyramid 8 Diamond Block\r
+    //pyramid 5 glass\r
+    //pyramid 2 mesecons:wire_00000000_off\r
 \r
 ### //spiral <width> <height> <spacer> <node>\r
 \r
 Add spiral at WorldEdit position 1 with width <width>, height <height>, space between walls <spacer>, composed of <node>.\r
 \r
-    //spiral 20 5 3 dirt\r
-    //spiral 5 2 1 default:glass\r
-    //spiral 7 1 5 stone\r
+    //spiral 20 5 3 Diamond Block\r
+    //spiral 5 2 1 glass\r
+    //spiral 7 1 5 mesecons:wire_00000000_off\r
 \r
 ### //copy x/y/z/? <amount>\r
 \r
@@ -218,17 +218,17 @@ Hide all nodes in the current WorldEdit region non-destructively.
 \r
 Suppress all <node> in the current WorldEdit region non-destructively.\r
 \r
-    //suppress dirt\r
-    //suppress default:glass\r
-    //suppress mesecons:mesecon\r
+    //suppress Diamond Block\r
+    //suppress glass\r
+    //suppress mesecons:wire_00000000_off\r
 \r
 ### //highlight <node>\r
 \r
 Highlight <node> in the current WorldEdit region by hiding everything else non-destructively.\r
 \r
-    //highlight dirt\r
-    //highlight default:glass\r
-    //highlight mesecons:mesecon\r
+    //highlight Diamond Block\r
+    //highlight glass\r
+    //highlight mesecons:wire_00000000_off\r
 \r
 ### //restore\r
 \r
index 2fc9e4a318faba702440be8c2e3eee0c98c07c71..3507bbecf91ea7454208a520958675e704558a67 100644 (file)
--- a/README.md
+++ b/README.md
@@ -20,6 +20,16 @@ When an axis is specified in a WorldEdit command, it is specified as one of the
 
 The value ? represents the axis the player is currently facing. If the player is facing more than one axis, the axis the player face direction is closest to will be used.
 
+Nodes
+-----
+Node names are required for many types of commands that identify or modify specific types of nodes. They can be specified in a number of ways.
+
+First, by description - the tooltip that appears when hovering over the item in an inventory. This is case insensitive and includes values such as "Cobblestone" and "bronze block". Note that certain commands (namely, `//replace` and `//replaceinverse`) do not support descriptions that contain spaces in the `<searchnode>` field.
+
+Second, by name - the node name that is defined by code, but without the mod name prefix. This is case sensitive and includes values such as "piston_normal_off" and "cactus". Nodes defined in the `default` mod always take precedence over other nodes when searching for the correct one, and if there are multiple possible nodes (such as "a:celery" and "b:celery"), one is chosen in no particular order.
+
+Finally, by full name - the unambiguous identifier of the node, prefixes and all. This is case sensitive and includes values such as "default:stone" and "mesecons:wire_00000000_off".
+
 Regions
 -------
 Most WorldEdit commands operate on regions. Regions are a set of two positions that define a 3D cube. They are local to each player and chat commands affect only the region for the player giving the commands.
index 8099d6937592fd42eff87ffae148e986de708f12..69e9804a36ddb6c60144b2aaaddd5f2f22689d65 100644 (file)
@@ -12,9 +12,23 @@ worldedit.player_notify = function(name, message)
 end\r
 \r
 --determines whether `nodename` is a valid node name, returning a boolean\r
-worldedit.node_is_valid = function(nodename)\r
-       return minetest.registered_nodes[nodename] ~= nil\r
-       or minetest.registered_nodes["default:" .. nodename] ~= nil\r
+worldedit.normalize_nodename = function(nodename)\r
+       if minetest.registered_nodes[nodename] then --directly found node name\r
+               return nodename\r
+       elseif minetest.registered_nodes["default:" .. nodename] then --found node name in default\r
+               return "default:" .. nodename\r
+       end\r
+       for key, value in pairs(minetest.registered_nodes) do\r
+               if key:find(":" .. nodename, 1, true) then --found in mod\r
+                       return key\r
+               end\r
+       end\r
+       for key, value in pairs(minetest.registered_nodes) do\r
+               if value.description:lower() == nodename:lower() then --found in description\r
+                       return key\r
+               end\r
+       end\r
+       return nil\r
 end\r
 \r
 --determines the axis in which a player is facing, returning an axis ("x", "y", or "z") and the sign (1 or -1)\r
@@ -178,7 +192,8 @@ minetest.register_chatcommand("/set", {
                        return\r
                end\r
 \r
-               if param == "" or not worldedit.node_is_valid(param) then\r
+               local node = worldedit.normalize_nodename(param)\r
+               if param == "" or not node then\r
                        worldedit.player_notify(name, "invalid node name: " .. param)\r
                        return\r
                end\r
@@ -188,7 +203,7 @@ minetest.register_chatcommand("/set", {
                        tenv = worldedit.queue_aliasenv\r
                end\r
 \r
-               local count = worldedit.set(pos1, pos2, param, tenv)\r
+               local count = worldedit.set(pos1, pos2, node, tenv)\r
                worldedit.player_notify(name, count .. " nodes set")\r
        end,\r
 })\r
@@ -204,16 +219,18 @@ minetest.register_chatcommand("/replace", {
                        return\r
                end\r
 \r
-               local found, _, searchnode, replacenode = param:find("^([^%s]+)%s+([^%s]+)$")\r
+               local found, _, searchnode, replacenode = param:find("^([^%s]+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(searchnode) then\r
+               local newsearchnode = worldedit.normalize_nodename(searchnode)\r
+               if not newsearchnode then\r
                        worldedit.player_notify(name, "invalid search node name: " .. searchnode)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(replacenode) then\r
+               local newreplacenode = worldedit.normalize_nodename(replacenode)\r
+               if not newreplacenode then\r
                        worldedit.player_notify(name, "invalid replace node name: " .. replacenode)\r
                        return\r
                end\r
@@ -222,7 +239,7 @@ minetest.register_chatcommand("/replace", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.replace(pos1, pos2, searchnode, replacenode, tenv)\r
+               local count = worldedit.replace(pos1, pos2, newsearchnode, newreplacenode, tenv)\r
                worldedit.player_notify(name, count .. " nodes replaced")\r
        end,\r
 })\r
@@ -238,16 +255,18 @@ minetest.register_chatcommand("/replaceinverse", {
                        return\r
                end\r
 \r
-               local found, _, searchnode, replacenode = param:find("^([^%s]+)%s+([^%s]+)$")\r
+               local found, _, searchnode, replacenode = param:find("^([^%s]+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(searchnode) then\r
+               local newsearchnode = worldedit.normalize_nodename(searchnode)\r
+               if not newsearchnode then\r
                        worldedit.player_notify(name, "invalid search node name: " .. searchnode)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(replacenode) then\r
+               local newreplacenode = worldedit.normalize_nodename(replacenode)\r
+               if not newreplacenode then\r
                        worldedit.player_notify(name, "invalid replace node name: " .. replacenode)\r
                        return\r
                end\r
@@ -272,13 +291,14 @@ minetest.register_chatcommand("/hollowsphere", {
                        return\r
                end\r
 \r
-               local found, _, radius, nodename = param:find("^(%d+)%s+([^%s]+)$")\r
+               local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -286,7 +306,7 @@ minetest.register_chatcommand("/hollowsphere", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.hollow_sphere(pos, tonumber(radius), nodename, tenv)\r
+               local count = worldedit.hollow_sphere(pos, tonumber(radius), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -302,13 +322,14 @@ minetest.register_chatcommand("/sphere", {
                        return\r
                end\r
 \r
-               local found, _, radius, nodename = param:find("^(%d+)%s+([^%s]+)$")\r
+               local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -316,7 +337,7 @@ minetest.register_chatcommand("/sphere", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.sphere(pos, tonumber(radius), nodename, tenv)\r
+               local count = worldedit.sphere(pos, tonumber(radius), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -332,13 +353,14 @@ minetest.register_chatcommand("/hollowdome", {
                        return\r
                end\r
 \r
-               local found, _, radius, nodename = param:find("^(%d+)%s+([^%s]+)$")\r
+               local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -346,7 +368,7 @@ minetest.register_chatcommand("/hollowdome", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.hollow_dome(pos, tonumber(radius), nodename, tenv)\r
+               local count = worldedit.hollow_dome(pos, tonumber(radius), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -362,13 +384,14 @@ minetest.register_chatcommand("/dome", {
                        return\r
                end\r
 \r
-               local found, _, radius, nodename = param:find("^(%d+)%s+([^%s]+)$")\r
+               local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -376,7 +399,7 @@ minetest.register_chatcommand("/dome", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.dome(pos, tonumber(radius), nodename, tenv)\r
+               local count = worldedit.dome(pos, tonumber(radius), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -392,7 +415,7 @@ minetest.register_chatcommand("/hollowcylinder", {
                        return\r
                end\r
 \r
-               local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+([^%s]+)$")\r
+               local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
@@ -401,8 +424,9 @@ minetest.register_chatcommand("/hollowcylinder", {
                        axis, sign = worldedit.player_axis(name)\r
                        length = length * sign\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -410,7 +434,7 @@ minetest.register_chatcommand("/hollowcylinder", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.hollow_cylinder(pos, axis, tonumber(length), tonumber(radius), nodename, tenv)\r
+               local count = worldedit.hollow_cylinder(pos, axis, tonumber(length), tonumber(radius), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -426,7 +450,7 @@ minetest.register_chatcommand("/cylinder", {
                        return\r
                end\r
 \r
-               local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+([^%s]+)$")\r
+               local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
@@ -435,8 +459,9 @@ minetest.register_chatcommand("/cylinder", {
                        axis, sign = worldedit.player_axis(name)\r
                        length = length * sign\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -444,7 +469,7 @@ minetest.register_chatcommand("/cylinder", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.cylinder(pos, axis, tonumber(length), tonumber(radius), nodename, tenv)\r
+               local count = worldedit.cylinder(pos, axis, tonumber(length), tonumber(radius), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -460,13 +485,14 @@ minetest.register_chatcommand("/pyramid", {
                        return\r
                end\r
 \r
-               local found, _, size, nodename = param:find("(%d+)%s+([^%s]+)$")\r
+               local found, _, size, nodename = param:find("(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -474,7 +500,7 @@ minetest.register_chatcommand("/pyramid", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.pyramid(pos, tonumber(size), nodename, tenv)\r
+               local count = worldedit.pyramid(pos, tonumber(size), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -490,13 +516,14 @@ minetest.register_chatcommand("/spiral", {
                        return\r
                end\r
 \r
-               local found, _, width, height, space, nodename = param:find("(%d+)%s+(%d+)%s+(%d+)%s+([^%s]+)$")\r
+               local found, _, width, height, space, nodename = param:find("(%d+)%s+(%d+)%s+(%d+)%s+(.+)$")\r
                if found == nil then\r
                        worldedit.player_notify(name, "invalid usage: " .. param)\r
                        return\r
                end\r
-               if not worldedit.node_is_valid(nodename) then\r
-                       worldedit.player_notify(name, "invalid node name: " .. param)\r
+               local node = worldedit.normalize_nodename(nodename)\r
+               if not node then\r
+                       worldedit.player_notify(name, "invalid node name: " .. nodename)\r
                        return\r
                end\r
 \r
@@ -504,7 +531,7 @@ minetest.register_chatcommand("/spiral", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.spiral(pos, tonumber(width), tonumber(height), tonumber(space), nodename, tenv)\r
+               local count = worldedit.spiral(pos, tonumber(width), tonumber(height), tonumber(space), node, tenv)\r
                worldedit.player_notify(name, count .. " nodes added")\r
        end,\r
 })\r
@@ -793,7 +820,8 @@ minetest.register_chatcommand("/suppress", {
                        return\r
                end\r
 \r
-               if param == "" or not worldedit.node_is_valid(param) then\r
+               local node = worldedit.node_is_valid(param)\r
+               if param == "" or not node then\r
                        worldedit.player_notify(name, "invalid node name: " .. param)\r
                        return\r
                end\r
@@ -802,7 +830,7 @@ minetest.register_chatcommand("/suppress", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.suppress(pos1, pos2, param, tenv)\r
+               local count = worldedit.suppress(pos1, pos2, node, tenv)\r
                worldedit.player_notify(name, count .. " nodes suppressed")\r
        end,\r
 })\r
@@ -818,7 +846,8 @@ minetest.register_chatcommand("/highlight", {
                        return\r
                end\r
 \r
-               if param == "" or not worldedit.node_is_valid(param) then\r
+               local node = worldedit.node_is_valid(param)\r
+               if param == "" or not node then\r
                        worldedit.player_notify(name, "invalid node name: " .. param)\r
                        return\r
                end\r
@@ -827,7 +856,7 @@ minetest.register_chatcommand("/highlight", {
                if worldedit.ENABLE_QUEUE then\r
                        tenv = worldedit.queue_aliasenv\r
                end\r
-               local count = worldedit.highlight(pos1, pos2, param, tenv)\r
+               local count = worldedit.highlight(pos1, pos2, node, tenv)\r
                worldedit.player_notify(name, count .. " nodes highlighted")\r
        end,\r
 })\r