Wrench: Fix node registration from other mods
This commit is contained in:
parent
86e083c409
commit
9b7c44b453
@ -69,23 +69,26 @@ 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()
|
||||||
local olddef = minetest.registered_nodes[name]
|
-- Delayed registration for foreign mod support
|
||||||
if olddef then
|
for name, info in pairs(wrench.registered_nodes) do
|
||||||
local newdef = {}
|
local olddef = minetest.registered_nodes[name]
|
||||||
for key, value in pairs(olddef) do
|
if olddef then
|
||||||
newdef[key] = value
|
local newdef = {}
|
||||||
|
for key, value in pairs(olddef) do
|
||||||
|
newdef[key] = value
|
||||||
|
end
|
||||||
|
newdef.stack_max = 1
|
||||||
|
newdef.description = S("%s with items"):format(newdef.description)
|
||||||
|
newdef.groups = {}
|
||||||
|
newdef.groups.not_in_creative_inventory = 1
|
||||||
|
newdef.on_construct = nil
|
||||||
|
newdef.on_destruct = nil
|
||||||
|
newdef.after_place_node = restore
|
||||||
|
minetest.register_node(":"..get_pickup_name(name), newdef)
|
||||||
end
|
end
|
||||||
newdef.stack_max = 1
|
|
||||||
newdef.description = S("%s with items"):format(newdef.description)
|
|
||||||
newdef.groups = {}
|
|
||||||
newdef.groups.not_in_creative_inventory = 1
|
|
||||||
newdef.on_construct = nil
|
|
||||||
newdef.on_destruct = nil
|
|
||||||
newdef.after_place_node = restore
|
|
||||||
minetest.register_node(":"..get_pickup_name(name), newdef)
|
|
||||||
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