summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-07 03:49:16 +0200
committerWuzzy <almikes@aol.com>2016-08-07 03:49:16 +0200
commit08d8d99ab3a1ca5e8e134fac7e550ae8e1861ec6 (patch)
treede741b21431335181c7e610da46c37117131ed4d
parent7d039147e71bcc4e947be0f3bfb38707790263fb (diff)
Add crafting type: digging by chance
-rw-r--r--api.lua21
-rw-r--r--locale/de.txt3
-rw-r--r--locale/template.txt3
-rw-r--r--textures/ui_craftgrid_icon.pngbin488 -> 896 bytes
4 files changed, 27 insertions, 0 deletions
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 b6831a9..6731327 100644
--- a/textures/ui_craftgrid_icon.png
+++ b/textures/ui_craftgrid_icon.png
Binary files differ