From 08d8d99ab3a1ca5e8e134fac7e550ae8e1861ec6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 7 Aug 2016 03:49:16 +0200 Subject: [PATCH] Add crafting type: digging by chance --- api.lua | 21 +++++++++++++++++++++ locale/de.txt | 3 +++ locale/template.txt | 3 +++ textures/ui_craftgrid_icon.png | Bin 488 -> 896 bytes 4 files changed, 27 insertions(+) diff --git a/api.lua b/api.lua index 872ce32..00c8f1b 100644 --- a/api.lua +++ b/api.lua @@ -55,6 +55,21 @@ minetest.after(0.01, function() }) end + elseif type(def.drop) == "table" then + for i=1,#def.drop.items do + local itit = def.drop.items[i] + for j=1,#itit.items do + local dstack = ItemStack(itit.items[j]) + if not dstack:is_empty() and dstack:get_name() ~= name then + unified_inventory.register_craft({ + type = "digging_chance", + items = {name}, + output = dstack:get_name(), + width = 0, + }) + end + end + end end end for _, recipes in pairs(unified_inventory.crafts_for.recipe) do @@ -203,6 +218,12 @@ unified_inventory.register_craft_type("digging", { height = 1, }) +unified_inventory.register_craft_type("digging_chance", { + description = "Digging (by chance)", + icon = "default_tool_steelpick.png^[transformFY.png", + width = 1, + height = 1, +}) function unified_inventory.register_page(name, def) unified_inventory.pages[name] = def diff --git a/locale/de.txt b/locale/de.txt index d678b68..5b28630 100644 --- a/locale/de.txt +++ b/locale/de.txt @@ -1,5 +1,8 @@ # Translation mostly by Xanthin +### api.lua ### +Digging (by chance) = Graben (durch Zufall) + ### bags.lua ### Bags = Rucksaecke Bag 1 = Rucksack 1 diff --git a/locale/template.txt b/locale/template.txt index ae382e3..4268257 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -1,5 +1,8 @@ # Translation by +### api.lua ### +Digging (by chance) = + # Template ### bags.lua ### Bags = diff --git a/textures/ui_craftgrid_icon.png b/textures/ui_craftgrid_icon.png index b6831a9c1d1a8e8cb292f4566badf19db2fc80ee..67313279d302cf78dbfb9d050b95a8d4fd9b89ab 100644 GIT binary patch literal 896 zcmeAS@N?(olHy`uVB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