forked from VoxeLibre/VoxeLibre
fix nodename pattern and add debug command (do not work)
This commit is contained in:
parent
669a9ff0a4
commit
11384bd73c
|
@ -133,7 +133,7 @@ mcl_commands.types = {
|
||||||
return S("Color is not a valid color name or hexadecimal!")
|
return S("Color is not a valid color name or hexadecimal!")
|
||||||
end
|
end
|
||||||
end},
|
end},
|
||||||
nodename = {"([A-Za-z_]+)",
|
nodename = {"^(%l+[%w_]+%:?[_%l]+[%w_]*)$",
|
||||||
function(res, pointer)
|
function(res, pointer)
|
||||||
if minetest.registered_items[res[pointer]] then
|
if minetest.registered_items[res[pointer]] then
|
||||||
return nil, res[pointer], pointer+1
|
return nil, res[pointer], pointer+1
|
||||||
|
|
|
@ -15,3 +15,21 @@ mcl_commands.register_command("setblock", {
|
||||||
params = S("<X>,<Y>,<Z> <NodeString>"),
|
params = S("<X>,<Y>,<Z> <NodeString>"),
|
||||||
privs = {give=true, interact=true},
|
privs = {give=true, interact=true},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
--DEBUG: must be removed later
|
||||||
|
mcl_commands.register_command("setdebug", {
|
||||||
|
func = function(cmd)
|
||||||
|
cmd:sub(":node:nodename", {
|
||||||
|
func = function(name, node)
|
||||||
|
minetest.set_node({x=0,y=0,z=0}, {name=node})
|
||||||
|
return true, S("@1 spawned.", node)
|
||||||
|
--return false, S("Invalid parameters (see /help setblock)")
|
||||||
|
end,
|
||||||
|
privs = {},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
description = S("Set node at given position"),
|
||||||
|
params = S("<X>,<Y>,<Z> <NodeString>"),
|
||||||
|
privs = {give=true, interact=true},
|
||||||
|
})
|
Loading…
Reference in New Issue