summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/api.lua b/api.lua
index c06f7ab..8c60fff 100644
--- a/api.lua
+++ b/api.lua
@@ -27,6 +27,21 @@ minetest.after(0.01, function()
table.sort(unified_inventory.items_list)
unified_inventory.items_list_size = #unified_inventory.items_list
print("Unified Inventory. inventory size: "..unified_inventory.items_list_size)
+ for _, name in ipairs(unified_inventory.items_list) do
+ local def = minetest.registered_items[name]
+ if type(def.drop) == "string" then
+ local dstack = ItemStack(def.drop)
+ if not dstack:is_empty() and dstack:get_name() ~= name then
+ unified_inventory.register_craft({
+ type = "digging",
+ items = {name},
+ output = def.drop,
+ width = 0,
+ })
+
+ end
+ end
+ end
end)