diff options
author | Zefram <zefram@fysh.org> | 2014-04-29 22:14:08 +0100 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2014-04-29 22:14:08 +0100 |
commit | 48d28b1e5d40c11769f189301af91eb9ebfbe6e5 (patch) | |
tree | 779c50d0b17bed57152bc24fa06d37aa12368ce6 /api.lua | |
parent | 87cfad559bff248bc675287ef02ee8cbe4a506d5 (diff) |
Show non-identity digging results in craft guide
Diffstat (limited to 'api.lua')
-rw-r--r-- | api.lua | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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) |