\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
\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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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