diff options
author | Wuzzy <almikes@aol.com> | 2016-08-06 17:44:37 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-06 17:44:37 +0200 |
commit | 1c11de10d5f66e920bc66eb2dbeb174a34624a53 (patch) | |
tree | cc2a670c203ea356d84ab5710e044a269e679af8 /bags.lua | |
parent | 7d039147e71bcc4e947be0f3bfb38707790263fb (diff) |
Add optional farming dependency for bag craft
Diffstat (limited to 'bags.lua')
-rw-r--r-- | bags.lua | 51 |
1 files changed, 26 insertions, 25 deletions
@@ -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 |