Last active
March 9, 2022 00:44
-
-
Save rubenwardy/9d59118bccc153a724925a7a7566f88d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wrapRegisterCall(name, func) | |
for key, v in pairs(minetest["registered_" .. name .. "s"]) do | |
func(key, v) | |
end | |
local old = minetest["register_" .. name] | |
minetest["register_" .. name] = function(name, def) | |
func(name, def) | |
old(name, def) | |
end | |
end | |
----------------------------------- | |
wrapCall("item", function(name, def) | |
def.foo = "bar" | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment