summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-06 17:44:37 +0200
committerWuzzy <almikes@aol.com>2016-08-06 17:44:37 +0200
commit1c11de10d5f66e920bc66eb2dbeb174a34624a53 (patch)
treecc2a670c203ea356d84ab5710e044a269e679af8
parent7d039147e71bcc4e947be0f3bfb38707790263fb (diff)
Add optional farming dependency for bag craft
-rw-r--r--bags.lua51
-rw-r--r--depends.txt2
2 files changed, 27 insertions, 26 deletions
diff --git a/bags.lua b/bags.lua
index 0dd391b..f8d3520 100644
--- a/bags.lua
+++ b/bags.lua
@@ -214,30 +214,31 @@ minetest.register_tool("unified_inventory:bag_large", {
})
-- register bag crafts
-minetest.register_craft({
- output = "unified_inventory:bag_small",
- recipe = {
- {"", "farming:cotton", ""},
- {"group:wool", "group:wool", "group:wool"},
- {"group:wool", "group:wool", "group:wool"},
- },
-})
-
-minetest.register_craft({
- output = "unified_inventory:bag_medium",
- recipe = {
- {"", "", ""},
- {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
- {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
- },
-})
+if minetest.get_modpath("farming") ~= nil then
+ minetest.register_craft({
+ output = "unified_inventory:bag_small",
+ recipe = {
+ {"", "farming:cotton", ""},
+ {"group:wool", "group:wool", "group:wool"},
+ {"group:wool", "group:wool", "group:wool"},
+ },
+ })
-minetest.register_craft({
- output = "unified_inventory:bag_large",
- recipe = {
- {"", "", ""},
- {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
- {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
- },
-})
+ minetest.register_craft({
+ output = "unified_inventory:bag_medium",
+ recipe = {
+ {"", "", ""},
+ {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
+ {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
+ },
+ })
+ minetest.register_craft({
+ output = "unified_inventory:bag_large",
+ recipe = {
+ {"", "", ""},
+ {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
+ {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
+ },
+ })
+end
diff --git a/depends.txt b/depends.txt
index a1ea556..3879b2c 100644
--- a/depends.txt
+++ b/depends.txt
@@ -1,4 +1,4 @@
creative?
intllib?
datastorage?
-
+farming?