summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2014-04-29 22:14:08 +0100
committerZefram <zefram@fysh.org>2014-04-29 22:14:08 +0100
commit48d28b1e5d40c11769f189301af91eb9ebfbe6e5 (patch)
tree779c50d0b17bed57152bc24fa06d37aa12368ce6 /api.lua
parent87cfad559bff248bc675287ef02ee8cbe4a506d5 (diff)
Show non-identity digging results in craft guide
Diffstat (limited to 'api.lua')
-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)