blockgame/mods/bg_api/wrappers.lua

31 lines
682 B
Lua
Raw Normal View History

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"
local callback = #args > 1 and args[2] or args[1]
minetest[function_name](callback)
]]--
minetest[function_name](...)
end
blockgame[function_name] = wrapper
end
for name in pairs({
register_abm = true,
2023-10-13 07:55:09 +00:00
register_lbm = true,
register_on_joinplayer = true,
register_node = true,
register_item = true,
register_on_placenode = true,
register_on_dignode = true,
register_on_punchnode = true,
register_globalstep = true,
}) do
create_plain_wrapper(name)
end