mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-09-12 08:08:30 +02:00
19 lines
445 B
Lua
19 lines
445 B
Lua
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)
|
|
return we_c.chatcommand_handler(name, player_name, param)
|
|
end,
|
|
})
|
|
worldedit.registered_commands[name] = def
|
|
end
|