From 846d253509a6ad07b5846c264920e59f850ca081 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 9 Jun 2014 18:40:16 +0100 Subject: [PATCH 1/2] Add support for the food mod's ingredient system --- desserts.lua | 26 +++++++++++++------------- drinks.lua | 4 ++-- foods.lua | 12 ++++++------ init.lua | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 21 deletions(-) diff --git a/desserts.lua b/desserts.lua index d80250d..744aa49 100644 --- a/desserts.lua +++ b/desserts.lua @@ -117,7 +117,7 @@ minetest.register_craft({ output = "mtfoods:short_bread", recipe = { {'mtfoods:dandelion_milk'}, - {'farming:bread'}, + {ing.bread}, {'mtfoods:sugar'}, } }) @@ -134,7 +134,7 @@ minetest.register_craft({ output = "mtfoods:chocolate 5", recipe = { {'mtfoods:sugar', 'mtfoods:dandelion_milk', 'mtfoods:sugar'}, - {'farming_plus:cocoa_bean', 'farming_plus:cocoa_bean', 'farming_plus:cocoa_bean'}, + {ing.cocoa, ing.cocoa, ing.cocoa}, {'mtfoods:sugar', 'mtfoods:dandelion_milk', 'mtfoods:sugar'}, } }) @@ -151,8 +151,8 @@ minetest.register_craft({ minetest.register_craft({ output = "mtfoods:strawberry_shortcake", recipe = { - {'mtfoods:cream', 'farming_plus:strawberry_item', 'mtfoods:cream'}, - {'farming_plus:strawberry_item', 'mtfoods:short_bread', 'farming_plus:strawberry_item'}, + {'mtfoods:cream', ing.strawberry, 'mtfoods:cream'}, + {ing.strawberry, 'mtfoods:short_bread', ing.strawberry}, } }) @@ -160,7 +160,7 @@ minetest.register_craft({ output = "mtfoods:cake", recipe = { {'', 'mtfoods:sugar', ''}, - {'mtfoods:dandelion_milk', 'farming:bread', 'mtfoods:dandelion_milk'}, + {'mtfoods:dandelion_milk', ing.bread, 'mtfoods:dandelion_milk'}, {'', 'mtfoods:sugar', ''}, } }) @@ -176,23 +176,23 @@ minetest.register_craft({ minetest.register_craft({ output = "mtfoods:carrot_cake", recipe = { - {'', 'farming_plus:carrot_item', ''}, - {'farming_plus:cocoa_bean', 'mtfoods:cake', 'farming_plus:cocoa_bean'}, + {'', ing.carrot, ''}, + {ing.cocoa, 'mtfoods:cake', ing.cocoa}, } }) minetest.register_craft({ output = "mtfoods:pie_crust", recipe = { - {'farming:bread', 'farming:flour'}, - {'farming:flour', 'mtfoods:sugar'}, + {ing.bread, ing.flour}, + {ing.flour, 'mtfoods:sugar'}, } }) minetest.register_craft({ output = "mtfoods:apple_pie", recipe = { - {'default:apple', 'default:apple', 'default:apple'}, + {ing.apple, ing.apple, ing.apple}, {'', 'mtfoods:pie_crust', ''}, } }) @@ -200,7 +200,7 @@ minetest.register_craft({ minetest.register_craft({ output = "mtfoods:rhubarb_pie", recipe = { - {'farming_plus:rhubarb_item', 'farming_plus:rhubarb_item', 'farming_plus:rhubarb_item'}, + {ing.rhubarb, ing.rhubarb, ing.rhubarb}, {'', 'mtfoods:pie_crust', ''}, } }) @@ -208,7 +208,7 @@ minetest.register_craft({ minetest.register_craft({ output = "mtfoods:banana_pie", recipe = { - {'farming_plus:banana', 'mtfoods:cream', 'farming_plus:banana'}, + {ing.banana, 'mtfoods:cream', ing.banana}, {'', 'mtfoods:pie_crust', ''}, } }) @@ -216,7 +216,7 @@ minetest.register_craft({ minetest.register_craft({ output = "mtfoods:pumpkin_pie", recipe = { - {'mtfoods:cream', 'farming:pumpkin', 'mtfoods:cream'}, + {'mtfoods:cream', ing.pumpkin, 'mtfoods:cream'}, {'', 'mtfoods:pie_crust', ''}, } }) diff --git a/drinks.lua b/drinks.lua index 4509015..29d4ec9 100644 --- a/drinks.lua +++ b/drinks.lua @@ -25,7 +25,7 @@ minetest.register_craftitem("mtfoods:orange_juice", { minetest.register_craft({ type = "shapeless", output = "mtfoods:orange_juice", - recipe = {'mtfoods:glass_flute', 'farming_plus:orange'} + recipe = {'mtfoods:glass_flute', ing.orange} }) --apple-- @@ -39,7 +39,7 @@ minetest.register_craftitem("mtfoods:apple_juice", { minetest.register_craft({ type = "shapeless", output = "mtfoods:apple_juice", - recipe = {'mtfoods:glass_flute', 'default:apple'} + recipe = {'mtfoods:glass_flute', ing.apple} }) --Apple Cider-- diff --git a/foods.lua b/foods.lua index 143c7db..04a0d07 100644 --- a/foods.lua +++ b/foods.lua @@ -12,9 +12,9 @@ minetest.register_craftitem( "mtfoods:mlt_burger", { minetest.register_craft({ output = "mtfoods:mlt_burger", recipe = { - {'farming:bread', 'mobs:meat', ''}, + {ing.bread, ing.meat, ''}, {'', 'default:junglegrass', ''}, - {'', 'farming_plus:tomato_item', 'farming:bread'}, + {'', ing.tomato, ing.bread}, } }) @@ -30,7 +30,7 @@ minetest.register_craftitem( "mtfoods:potato_slices", { minetest.register_craft({ output = "mtfoods:potato_slices", recipe = { - {'farming_plus:potatoe_item'}, + {ing.potato}, } }) @@ -59,7 +59,7 @@ minetest.register_craftitem( "mtfoods:medicine", { minetest.register_craft({ output = "mtfoods:medicine", recipe = { - {'', 'farming:wheat', ''}, + {'', ing.wheat, ''}, {'mtfoods:dandelion_milk', 'default:junglegrass', 'mtfoods:chocolate'}, {'', 'vessels:glass_bottle', ''}, } @@ -84,7 +84,7 @@ minetest.register_node( "mtfoods:casserole",{ minetest.register_craft({ output = "mtfoods:casserole", recipe = { - {'farming_plus:carrot_item', 'farming_plus:potatoe_item', 'farming_plus:tomato_item'}, - {'', 'farming:bread', ''}, + {ing.carrot, ing.potato, ing.tomato}, + {'', ing.bread, ''}, } }) diff --git a/init.lua b/init.lua index 11b896e..881e569 100644 --- a/init.lua +++ b/init.lua @@ -2,6 +2,47 @@ --By: Philipbenr-- --Licence: GPLv3-- +ing = { + orange = "farming_plus:orange", + apple = "default:apple", + meat = "mobs:meat", + bread = "farming:bread", + tomato = "farming_plus:tomato_item", + wheat = "farming:wheat", + carrot = "farming_plus:carrot_item", + potato = "farming_plus:potato_item", + cocoa = "farming_plus:cocoa_bean", + strawberry = "farming_plus:strawberry_item", + flour = "farming:flour", + rhubarb = "farming_plus:rhubarb_item", + banana = "farming_plus:banana", + pumpkin = "farming:pumpkin", +} + +-- Add support for the food mod's ingredient list +if minetest.get_modpath("food") then + food.support("strawberry","farming_plus","farming_plus:strawberry_item") + food.support("strawberry","plantlib","plantlib:strawberry") + food.support("strawberry","bushes_classic","bushes:strawberry") + food.support("rhubarb","farming_plus","farming_plus:rhubarb_item") + ing = { + orange = "farming_plus:orange", + apple = "default:apple", + meat = "group:food_meat", + bread = "farming:bread", + tomato = "group:food_tomato", + wheat = "group:food_wheat", + carrot = "group:food_carrot", + potato = "group:food_potato", + cocoa = "group:food_cocoa", + strawberry = "group:food_strawberry", + flour = "group:food_flour", + rhubarb = "group:food_rhubarb", + banana = "farming_plus:banana", + pumpkin = "farming:pumpkin", + } +end + dofile(minetest.get_modpath("mtfoods").."/desserts.lua") dofile(minetest.get_modpath("mtfoods").."/foods.lua") dofile(minetest.get_modpath("mtfoods").."/drinks.lua") From 5d9141ba48b4a43b2a16a888e95fa5944e6acb26 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 9 Jun 2014 18:52:33 +0100 Subject: [PATCH 2/2] Add optional dependancy on the food mod --- depends.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/depends.txt b/depends.txt index 03af5e1..f261dc1 100644 --- a/depends.txt +++ b/depends.txt @@ -4,3 +4,4 @@ farming farming_plus? vessels flowers? +food?