added support for food mod (thanks bell07)
This commit is contained in:
parent
e3127ee5e0
commit
af7682a114
83
init.lua
83
init.lua
@ -3,6 +3,7 @@
|
||||
local hmod = minetest.get_modpath("hunger")
|
||||
local hbmod = minetest.get_modpath("hbhunger")
|
||||
local stmod = minetest.get_modpath("stamina")
|
||||
local foodmod = minetest.get_modpath("food")
|
||||
|
||||
-- eat pie slice function
|
||||
local replace_pie = function(node, puncher, pos)
|
||||
@ -162,15 +163,45 @@ local register_pie = function(pie, desc)
|
||||
|
||||
end
|
||||
|
||||
local ingredients = {}
|
||||
|
||||
if foodmod then
|
||||
ingredients.sugar = "group:food_sugar"
|
||||
ingredients.milk = "group:food_milk"
|
||||
ingredients.egg = "group:food_egg"
|
||||
ingredients.wheat = "group:food_wheat"
|
||||
ingredients.flour = "group:food_flour"
|
||||
ingredients.cocoa = "group:food_cocoa"
|
||||
ingredients.coffee = "group:food_coffee"
|
||||
ingredients.strawberry = "group:food_strawberry"
|
||||
ingredients.cheese = "group:food_cheese"
|
||||
ingredients.meat_raw = "group:food_meat_raw"
|
||||
ingredients.banana = "group:food_banana"
|
||||
ingredients.orange = "group:food_orange"
|
||||
else
|
||||
ingredients.sugar = "farming:sugar"
|
||||
ingredients.milk = "mobs:bucket_milk"
|
||||
ingredients.egg = "mobs:egg"
|
||||
ingredients.wheat = "farming:wheat"
|
||||
ingredients.flour = "farming:flour"
|
||||
ingredients.cocoa = "farming:cocoa_beans"
|
||||
ingredients.coffee = "farming:coffee_beans"
|
||||
ingredients.strawberry = "ethereal:strawberry"
|
||||
ingredients.cheese = "mobs:cheese"
|
||||
ingredients.meat_raw = "mobs:meat_raw"
|
||||
ingredients.banana = "ethereal:banana"
|
||||
ingredients.orange = "ethereal:orange"
|
||||
end
|
||||
|
||||
-- normal cake
|
||||
register_pie("pie", "Cake")
|
||||
|
||||
minetest.register_craft({
|
||||
output = "pie:pie_0",
|
||||
recipe = {
|
||||
{"farming:sugar", "mobs:bucket_milk", "farming:sugar"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:wheat", "farming:flour", "farming:wheat"},
|
||||
{ingredients.sugar, ingredients.milk, ingredients.sugar},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.wheat, ingredients.flour, ingredients.wheat},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
@ -181,9 +212,9 @@ register_pie("choc", "Chocolate Cake")
|
||||
minetest.register_craft({
|
||||
output = "pie:choc_0",
|
||||
recipe = {
|
||||
{"farming:cocoa_beans", "mobs:bucket_milk", "farming:cocoa_beans"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:wheat", "farming:flour", "farming:wheat"},
|
||||
{ingredients.cocoa, ingredients.milk, ingredients.cocoa},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.wheat, ingredients.flour, ingredients.wheat},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
@ -194,9 +225,9 @@ register_pie("scsk", "Strawberry Cheesecake")
|
||||
minetest.register_craft({
|
||||
output = "pie:scsk_0",
|
||||
recipe = {
|
||||
{"ethereal:strawberry", "mobs:bucket_milk", "ethereal:strawberry"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:wheat", "farming:flour", "farming:wheat"},
|
||||
{ingredients.strawberry, ingredients.milk, ingredients.strawberry},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.wheat, ingredients.flour, ingredients.wheat},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
@ -207,9 +238,9 @@ register_pie("coff", "Coffee Cake")
|
||||
minetest.register_craft({
|
||||
output = "pie:coff_0",
|
||||
recipe = {
|
||||
{"farming:coffee_beans", "mobs:bucket_milk", "farming:coffee_beans"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:wheat", "farming:flour", "farming:wheat"},
|
||||
{ingredients.coffee, ingredients.milk, ingredients.coffee},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.wheat, ingredients.flour, ingredients.wheat},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
@ -220,9 +251,9 @@ register_pie("rvel", "Red Velvet Cake")
|
||||
minetest.register_craft({
|
||||
output = "pie:rvel_0",
|
||||
recipe = {
|
||||
{"farming:cocoa_beans", "mobs:bucket_milk", "dye:red"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:flour", "mobs:cheese", "farming:flour"},
|
||||
{ingredients.cocoa, ingredients.milk, "dye:red"},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.flour, ingredients.cheese, ingredients.flour},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
@ -233,8 +264,8 @@ register_pie("meat", "Meat Cake")
|
||||
minetest.register_craft({
|
||||
output = "pie:meat_0",
|
||||
recipe = {
|
||||
{"mobs:meat_raw", "mobs:egg", "mobs:meat_raw"},
|
||||
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
||||
{ingredients.meat_raw, ingredients.egg, ingredients.meat_raw},
|
||||
{ingredients.wheat, ingredients.wheat, ingredients.wheat},
|
||||
{"", "", ""}
|
||||
},
|
||||
})
|
||||
@ -245,9 +276,9 @@ register_pie("bana", "Banana Cake")
|
||||
minetest.register_craft({
|
||||
output = "pie:bana_0",
|
||||
recipe = {
|
||||
{"ethereal:banana", "mobs:bucket_milk", "ethereal:banana"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:wheat", "farming:flour", "farming:wheat"},
|
||||
{ingredients.banana, ingredients.milk, ingredients.banana},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.wheat, ingredients.flour, ingredients.wheat},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
@ -258,9 +289,9 @@ register_pie("brpd","Bread Pudding")
|
||||
minetest.register_craft({
|
||||
output = "pie:brpd_0",
|
||||
recipe = {
|
||||
{"farming:bread", "mobs:bucket_milk", "farming:bread"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:wheat", "farming:flour", "farming:wheat"},
|
||||
{"farming:bread", ingredients.milk, "farming:bread"},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.wheat, ingredients.flour, ingredients.wheat},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
@ -271,9 +302,9 @@ register_pie("orange","Orange Pie")
|
||||
minetest.register_craft({
|
||||
output = "pie:orange_0",
|
||||
recipe = {
|
||||
{"ethereal:orange", "mobs:bucket_milk", "ethereal:orange"},
|
||||
{"farming:sugar", "mobs:egg", "farming:sugar"},
|
||||
{"farming:wheat", "farming:flour", "farming:wheat"},
|
||||
{ingredients.orange, ingredients.milk, ingredients.orange},
|
||||
{ingredients.sugar, ingredients.egg, ingredients.sugar},
|
||||
{ingredients.wheat, ingredients.flour, ingredients.wheat},
|
||||
},
|
||||
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user