diff options
author | Uberi <azhang9@gmail.com> | 2014-07-18 16:09:57 -0400 |
---|---|---|
committer | Uberi <azhang9@gmail.com> | 2014-07-18 16:09:57 -0400 |
commit | 38fbc0a0461ea59c6d8a6dc9cd8b8cd24b374b24 (patch) | |
tree | f08e73d4f780056425f3212387719ea257cdc679 /worldedit_commands | |
parent | 4b178bf709fe8f870c6c7547da292fa0ea357d73 (diff) |
Fix //mix and improve normalize_nodename.
Diffstat (limited to 'worldedit_commands')
-rw-r--r-- | worldedit_commands/init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 53bd827..3613cfa 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -38,6 +38,7 @@ end --determines whether `nodename` is a valid node name, returning a boolean
worldedit.normalize_nodename = function(nodename)
+ nodename = nodename:gsub("^%s*(.-)%s*$", "%1")
if nodename == "" then return nil end
local fullname = ItemStack({name=nodename}):get_name() --resolve aliases of node names to full names
if minetest.registered_nodes[fullname] or fullname == "air" then --directly found node name or alias of nodename
@@ -300,7 +301,7 @@ minetest.register_chatcommand("/mix", { privs = {worldedit=true},
func = safe_region(function(name, param)
local nodes = {}
- for nodename in param:gmatch("[^,]+") do
+ for nodename in param:gmatch("[^%s]+") do
local node = get_node(name, nodename)
if not node then
worldedit.player_notify(name, "Could not identify node \"" .. name .. "\"")
|