summaryrefslogtreecommitdiff
path: root/bags.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-07 12:57:06 -0400
committerGitHub <noreply@github.com>2016-08-07 12:57:06 -0400
commit8332707198f0e1a35b8e1683feaccce5280e0da3 (patch)
treeff6f6eb31317ceec6121ff8132ae118a5f6bd1c1 /bags.lua
parent6ec72eba74ab832da3cd79cdf37d1dd9a4603720 (diff)
parent1c11de10d5f66e920bc66eb2dbeb174a34624a53 (diff)
Merge pull request #61 from Wuzzy2/bagdep
Add optional farming dependency for bag craft
Diffstat (limited to 'bags.lua')
-rw-r--r--bags.lua51
1 files changed, 26 insertions, 25 deletions
diff --git a/bags.lua b/bags.lua
index 08c25f9..7e925db 100644
--- a/bags.lua
+++ b/bags.lua
@@ -215,30 +215,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