Categories: Improve automatic ore categorization

This function is now executed after registering all recipes
within unified_inventory to properly register all item drops
as ores.
This commit is contained in:
SmallJoker
2024-01-13 10:40:25 +01:00
parent eb3bb03ebf
commit 004a39aaf7
3 changed files with 77 additions and 75 deletions

View File

@ -115,6 +115,11 @@ function unified_inventory.set_category_index(category_name, index)
update_category_list()
end
function unified_inventory.add_category_item(category_name, item)
if type(item) ~= "string" then
minetest.log("warning", "[unified_inventory] Cannot register category item: " .. dump(item))
return
end
ensure_category_exists(category_name)
unified_inventory.registered_category_items[category_name][item] = true
end