Wrench: Fix node registration from other mods

This commit is contained in:
SmallJoker 2023-01-29 13:11:37 +01:00
parent 86e083c409
commit 9b7c44b453

View File

@ -69,6 +69,8 @@ local function restore(pos, placer, itemstack)
return itemstack
end
minetest.register_on_mods_loaded(function()
-- Delayed registration for foreign mod support
for name, info in pairs(wrench.registered_nodes) do
local olddef = minetest.registered_nodes[name]
if olddef then
@ -86,6 +88,7 @@ for name, info in pairs(wrench.registered_nodes) do
minetest.register_node(":"..get_pickup_name(name), newdef)
end
end
end)
minetest.register_tool("wrench:wrench", {
description = S("Wrench"),