21 lines
458 B
Lua
21 lines
458 B
Lua
|
local function create_plain_wrapper (function_name)
|
||
|
local wrapper = function (...)
|
||
|
local args = {...}
|
||
|
|
||
|
-- labels will be used later, probably.
|
||
|
local label = #args > 1 and args[1] or "unlabeled function"
|
||
|
local callback = #args > 1 and args[2] or args[1]
|
||
|
|
||
|
minetest[function_name](callback)
|
||
|
end
|
||
|
|
||
|
blockgame[function_name] = wrapper
|
||
|
end
|
||
|
|
||
|
for name in pairs({
|
||
|
register_abm = true,
|
||
|
register_on_joinplayer = true,
|
||
|
}) do
|
||
|
create_plain_wrapper(name)
|
||
|
end
|