diff --git a/mods/bg_api/wrappers.lua b/mods/bg_api/wrappers.lua index ffc2752..24ef6f1 100644 --- a/mods/bg_api/wrappers.lua +++ b/mods/bg_api/wrappers.lua @@ -32,6 +32,8 @@ local function capitalize (str) return string.upper(string.sub(str, 1, 1)) .. string.sub(str, 2) end +local events = blockgame.events.namespace("api") + function blockgame.register_node (name, def) local modname = minetest.get_current_modname() local full_name = modname .. ":" .. name @@ -41,5 +43,17 @@ function blockgame.register_node (name, def) modname .. "_" .. name .. ".png", } + events.broadcast("before_register_node", { + name = name, + def = def, + mod = modname, + }) + minetest.register_node(full_name, def) + + events.broadcast("after_register_node", { + name = name, + def = def, + mod = modname, + }) end