mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-04 23:33:01 +00:00
18 lines
445 B
Lua
18 lines
445 B
Lua
local we_c = worldeditadditions_core
|
|
function we_c.override_command(name, def)
|
|
local success, def = we_c.check(def)
|
|
|
|
if not success then
|
|
return false, def
|
|
end
|
|
|
|
minetest.override_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
|