forked from minetest-mods/unified_inventory
Remove unnecessary recipe table copying
This commit is contained in:
parent
26473a8346
commit
34fe44356d
11
api.lua
11
api.lua
@ -8,19 +8,16 @@ minetest.after(0.01, function()
|
|||||||
def.description and def.description ~= "" then
|
def.description and def.description ~= "" then
|
||||||
table.insert(unified_inventory.items_list, name)
|
table.insert(unified_inventory.items_list, name)
|
||||||
local recipes = minetest.get_all_craft_recipes(name)
|
local recipes = minetest.get_all_craft_recipes(name)
|
||||||
if unified_inventory.crafts_table[name] == nil then
|
|
||||||
unified_inventory.crafts_table[name] = {}
|
|
||||||
end
|
|
||||||
if recipes then
|
if recipes then
|
||||||
for i=1,#recipes,1 do
|
unified_inventory.crafts_table[name] = recipes
|
||||||
table.insert(unified_inventory.crafts_table[name],recipes[i])
|
else
|
||||||
end
|
unified_inventory.crafts_table[name] = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(unified_inventory.items_list)
|
table.sort(unified_inventory.items_list)
|
||||||
unified_inventory.items_list_size = #unified_inventory.items_list
|
unified_inventory.items_list_size = #unified_inventory.items_list
|
||||||
print("Unified Inventory. inventory size: "..#unified_inventory.items_list)
|
print("Unified Inventory. inventory size: "..unified_inventory.items_list_size)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user