mirror of
https://github.com/minetest-mods/moreores.git
synced 2024-11-19 22:03:45 +01:00
parent
4f7ec3b3ae
commit
c9e25aca43
11
init.lua
11
init.lua
@ -107,12 +107,19 @@ local function add_ore(modname, description, mineral_name, oredef, extra_node_de
|
|||||||
local lump_item = item_base .. "_lump"
|
local lump_item = item_base .. "_lump"
|
||||||
|
|
||||||
local function merge_tables(t1, t2)
|
local function merge_tables(t1, t2)
|
||||||
if t2 then
|
for k, v in pairs(t2) do
|
||||||
for k,v in pairs(t2) do t1[k] = v end
|
if type(v) == "table" and type(t1[k]) == "table" then
|
||||||
|
-- If both t1[k] and v are tables, merge them recursively
|
||||||
|
merge_tables(t1[k], v)
|
||||||
|
else
|
||||||
|
-- Otherwise, simply set the value
|
||||||
|
t1[k] = v
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return t1
|
return t1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if oredef.makes.ore then
|
if oredef.makes.ore then
|
||||||
local node_def_tbl = {
|
local node_def_tbl = {
|
||||||
description = S("@1 Ore", S(description)),
|
description = S("@1 Ore", S(description)),
|
||||||
|
Loading…
Reference in New Issue
Block a user