Minetest-WorldEditAdditions/worldeditadditions_core/register/register.lua

19 lines
445 B
Lua
Raw Normal View History

2021-06-30 01:53:14 +00:00
local we_c = worldeditadditions_core
function we_c.register_command(name, def)
local success, def = we_c.check(def)
if not success then
return false, def
end
minetest.register_chatcommand("/" .. name, {
privs = def.privs,
params = def.params,
description = def.description,
func = function(player_name, param)
2021-06-30 15:36:04 +00:00
return we_c.chatcommand_handler(name, player_name, param)
2021-06-30 01:53:14 +00:00
end,
})
worldedit.registered_commands[name] = def
end