mirror of
https://github.com/minetest-mods/technic.git
synced 2025-01-09 01:30:21 +01:00
Wrench: Fix node registration from other mods
This commit is contained in:
parent
86e083c409
commit
9b7c44b453
@ -69,7 +69,9 @@ local function restore(pos, placer, itemstack)
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
for name, info in pairs(wrench.registered_nodes) do
|
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]
|
local olddef = minetest.registered_nodes[name]
|
||||||
if olddef then
|
if olddef then
|
||||||
local newdef = {}
|
local newdef = {}
|
||||||
@ -85,7 +87,8 @@ for name, info in pairs(wrench.registered_nodes) do
|
|||||||
newdef.after_place_node = restore
|
newdef.after_place_node = restore
|
||||||
minetest.register_node(":"..get_pickup_name(name), newdef)
|
minetest.register_node(":"..get_pickup_name(name), newdef)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
minetest.register_tool("wrench:wrench", {
|
minetest.register_tool("wrench:wrench", {
|
||||||
description = S("Wrench"),
|
description = S("Wrench"),
|
||||||
|
Loading…
Reference in New Issue
Block a user