2013-09-05 20:12:08 +02:00
|
|
|
-- FOOD MOD
|
2013-03-28 18:28:10 +01:00
|
|
|
-- A mod written by rubenwardy that adds
|
|
|
|
-- food to the minetest game
|
|
|
|
-- =====================================
|
2014-11-16 13:48:24 +01:00
|
|
|
-- >> food_basic/init.lua
|
2014-08-27 20:30:45 +02:00
|
|
|
-- Some basic foods
|
2013-03-28 18:28:10 +01:00
|
|
|
-- =====================================
|
|
|
|
|
2021-03-11 21:01:56 +01:00
|
|
|
print("Food Mod - Version 2.4")
|
2014-04-10 20:18:25 +02:00
|
|
|
|
2021-03-11 21:01:56 +01:00
|
|
|
dofile(minetest.get_modpath("food_basic").."/settings.lua")
|
2014-11-16 14:05:15 +01:00
|
|
|
dofile(minetest.get_modpath("food_basic").."/support.lua")
|
|
|
|
dofile(minetest.get_modpath("food_basic").."/ingredients.lua")
|
2013-09-05 20:12:08 +02:00
|
|
|
|
2015-01-04 18:31:30 +01:00
|
|
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
|
|
|
local S = 0
|
2017-04-03 01:50:59 +02:00
|
|
|
if minetest.get_modpath("intllib") then
|
|
|
|
S = intllib.Getter()
|
2015-01-04 18:31:30 +01:00
|
|
|
else
|
|
|
|
S = function ( s ) return s end
|
|
|
|
end
|
2014-04-10 20:18:25 +02:00
|
|
|
|
2021-03-11 21:01:56 +01:00
|
|
|
-- Register Venison
|
|
|
|
food.module("meat_cooked", function()
|
|
|
|
minetest.register_craftitem(":food:meat", {
|
|
|
|
description = S("Venison"),
|
|
|
|
inventory_image = "food_meat.png",
|
|
|
|
groups = {food_meat=1, food_meat_cooked=1}
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "food:meat",
|
|
|
|
recipe = "group:food_meat_raw",
|
|
|
|
cooktime = 30
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
|
2014-08-27 20:30:45 +02:00
|
|
|
-- Register dark chocolate
|
|
|
|
food.module("dark_chocolate", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:dark_chocolate",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Dark Chocolate"),
|
|
|
|
inventory_image = "food_dark_chocolate.png",
|
|
|
|
on_use = food.item_eat(3),
|
|
|
|
groups = {food_dark_chocolate=1}
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:dark_chocolate",
|
2013-09-05 20:12:08 +02:00
|
|
|
recipe = {
|
2014-08-27 20:30:45 +02:00
|
|
|
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"}
|
2013-09-05 20:12:08 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end)
|
2013-09-16 20:21:22 +02:00
|
|
|
|
2014-08-27 20:30:45 +02:00
|
|
|
-- Register milk chocolate
|
|
|
|
food.module("milk_chocolate", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:milk_chocolate",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Milk Chocolate"),
|
|
|
|
inventory_image = "food_milk_chocolate.png",
|
|
|
|
on_use = food.item_eat(3),
|
|
|
|
groups = {food_milk_chocolate=1}
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:milk_chocolate",
|
2013-09-05 20:12:08 +02:00
|
|
|
recipe = {
|
2014-08-27 20:30:45 +02:00
|
|
|
{"","group:food_milk",""},
|
|
|
|
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"}
|
2021-03-11 21:01:56 +01:00
|
|
|
},
|
|
|
|
replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"},
|
|
|
|
{"mobs:glass_milk", "vessels:drinking_glass"},
|
|
|
|
{"farming:soy_milk", "vessels:drinking_glass"}}
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
|
|
|
end)
|
2014-08-27 20:30:45 +02:00
|
|
|
|
|
|
|
-- Register baked potato
|
|
|
|
food.module("baked_potato", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:baked_potato", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Baked Potato"),
|
|
|
|
inventory_image = "food_baked_potato.png",
|
|
|
|
on_use = food.item_eat(6),
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
type = "cooking",
|
|
|
|
output = "food:baked_potato",
|
|
|
|
recipe = "group:food_potato",
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
|
|
|
end)
|
2014-08-27 20:30:45 +02:00
|
|
|
|
|
|
|
-- Register pasta bake
|
|
|
|
food.module("pasta_bake", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:pasta_bake",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Pasta Bake"),
|
|
|
|
inventory_image = "food_pasta_bake.png",
|
|
|
|
on_use = food.item_eat(4),
|
|
|
|
groups = {food=3}
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:pasta_bake_raw",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Raw Pasta Bake"),
|
|
|
|
inventory_image = "food_pasta_bake_raw.png",
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:pasta_bake",
|
|
|
|
type = "cooking",
|
|
|
|
recipe = "food:pasta_bake_raw"
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:pasta_bake_raw",
|
|
|
|
recipe = {
|
|
|
|
{"group:food_cheese"},
|
|
|
|
{"group:food_pasta"},
|
|
|
|
{"group:food_bowl"}
|
2021-03-11 21:01:56 +01:00
|
|
|
},
|
2013-09-05 20:12:08 +02:00
|
|
|
})
|
|
|
|
end)
|
2014-08-27 20:30:45 +02:00
|
|
|
|
|
|
|
-- Register Soups
|
|
|
|
local soups = {
|
|
|
|
{"tomato", "tomato"},
|
2021-03-11 21:01:56 +01:00
|
|
|
{"chicken", "meat_raw"}
|
2014-08-27 20:30:45 +02:00
|
|
|
}
|
2021-03-11 21:01:56 +01:00
|
|
|
local repl_bucket = food.bing["bucket_empty"] ~= "none" and
|
|
|
|
{{"group:food_water_bucket", food.bing["bucket_empty"].." 2"}} or nil
|
2014-08-27 20:30:45 +02:00
|
|
|
for i=1, #soups do
|
|
|
|
local flav = soups[i]
|
|
|
|
food.module("soup_"..flav[1], function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:soup_"..flav[1],{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S(flav[1].." Soup"),
|
|
|
|
inventory_image = "food_soup_"..flav[1]..".png",
|
|
|
|
on_use = food.item_eat(4),
|
|
|
|
groups = {food=3}
|
|
|
|
})
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:soup_"..flav[1].."_raw",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Uncooked ".. flav[1].." Soup"),
|
|
|
|
inventory_image = "food_soup_"..flav[1].."_raw.png",
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "food:soup_"..flav[1],
|
|
|
|
recipe = "food:soup_"..flav[1].."_raw",
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
output = "food:soup_"..flav[1].."_raw",
|
|
|
|
recipe = {
|
|
|
|
{"", "", ""},
|
2021-03-11 21:01:56 +01:00
|
|
|
{"group:food_water_bucket", "group:food_"..flav[2], "group:food_water_bucket"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"", "group:food_bowl", ""},
|
|
|
|
},
|
2021-03-11 21:01:56 +01:00
|
|
|
replacements = repl_bucket
|
2014-08-27 20:30:45 +02:00
|
|
|
})
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Juices
|
2014-11-16 13:38:20 +01:00
|
|
|
local juices = {"apple", "orange", "cactus"}
|
2014-08-27 20:30:45 +02:00
|
|
|
for i=1, #juices do
|
|
|
|
local flav = juices[i]
|
|
|
|
food.module(flav.."_juice", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:"..flav.."_juice", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S(flav.." Juice"),
|
|
|
|
inventory_image = "food_"..flav.."_juice.png",
|
2021-03-11 21:01:56 +01:00
|
|
|
on_use = food.item_eat(2, food.bing["cup"]),
|
|
|
|
groups = {["food_"..flav.."_juice"] = 1, vessel = 1}
|
2014-11-16 13:38:20 +01:00
|
|
|
})
|
2014-08-27 20:30:45 +02:00
|
|
|
food.craft({
|
2021-03-11 21:01:56 +01:00
|
|
|
output = "food:"..flav.."_juice",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
|
|
|
{"","",""},
|
2014-11-16 13:38:20 +01:00
|
|
|
{"","group:food_"..flav,""},
|
2021-03-11 21:01:56 +01:00
|
|
|
{"",food.bing["cup"],""},
|
2014-08-27 20:30:45 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
food.module("rainbow_juice", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:rainbow_juice", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Rainbow Juice"),
|
|
|
|
inventory_image = "food_rainbow_juice.png",
|
2021-03-11 21:01:56 +01:00
|
|
|
on_use = food.item_eat(20, food.bing["cup"]),
|
|
|
|
groups = { vessel = 1 }
|
2013-09-10 19:35:04 +02:00
|
|
|
})
|
2014-08-27 20:30:45 +02:00
|
|
|
|
2021-03-11 21:01:56 +01:00
|
|
|
if minetest.registered_items["default:nyancat_rainbow"] then
|
|
|
|
food.craft({
|
|
|
|
output = "food:rainbow_juice 99",
|
|
|
|
recipe = {
|
|
|
|
{"","",""},
|
|
|
|
{"","default:nyancat_rainbow",""},
|
|
|
|
{"",food.bing["cup"],""},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2021-03-11 21:01:56 +01:00
|
|
|
output = "food:rainbow_juice 3",
|
|
|
|
recipe = {
|
|
|
|
{"group:food_apple_juice","group:food_apple_juice","group:food_apple_juice"},
|
|
|
|
{"group:food_orange_juice","group:food_orange_juice","group:food_orange_juice"},
|
|
|
|
{"group:food_cactus_juice","group:food_cactus_juice","group:food_cactus_juice"}
|
|
|
|
}
|
2013-09-10 19:35:04 +02:00
|
|
|
})
|
|
|
|
end)
|
2014-08-27 20:30:45 +02:00
|
|
|
|
|
|
|
food.cake_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.250000,-0.500000,-0.296880,0.250000,-0.250000,0.312502},
|
|
|
|
{-0.309375,-0.500000,-0.250000,0.309375,-0.250000,0.250000},
|
|
|
|
{-0.250000,-0.250000,-0.250000,0.250000,-0.200000,0.250000}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Register cakes
|
|
|
|
food.module("cake", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_node(":food:cake", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Cake"),
|
|
|
|
on_use = food.item_eat(4),
|
|
|
|
groups={food=3,crumbly=3},
|
|
|
|
tiles = {
|
|
|
|
"food_cake_texture.png",
|
|
|
|
"food_cake_texture.png",
|
|
|
|
"food_cake_texture_side.png",
|
|
|
|
"food_cake_texture_side.png",
|
|
|
|
"food_cake_texture_side.png",
|
|
|
|
"food_cake_texture_side.png"
|
|
|
|
},
|
|
|
|
walkable = false,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
drawtype="nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
node_box = food.cake_box
|
2013-09-10 19:35:04 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2013-09-10 19:35:04 +02:00
|
|
|
type = "cooking",
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:cake",
|
|
|
|
recipe = "food:cakemix_plain",
|
|
|
|
cooktime = 10,
|
2013-09-10 19:35:04 +02:00
|
|
|
})
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:cakemix_plain",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Cake Mix"),
|
|
|
|
inventory_image = "food_cakemix_plain.png",
|
2014-04-11 17:48:31 +02:00
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:cakemix_plain",
|
2014-04-11 17:48:31 +02:00
|
|
|
recipe = {
|
2014-08-27 20:30:45 +02:00
|
|
|
{"group:food_flour","group:food_sugar","group:food_egg"},
|
2014-04-11 17:48:31 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end)
|
2013-03-28 18:28:10 +01:00
|
|
|
|
|
|
|
|
2014-08-27 20:30:45 +02:00
|
|
|
food.module("cake_choco", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_node(":food:cake_choco", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Chocolate Cake"),
|
2013-09-10 19:35:04 +02:00
|
|
|
on_use = food.item_eat(4),
|
2014-08-27 20:30:45 +02:00
|
|
|
groups={food=3,crumbly=3},
|
|
|
|
tiles = {
|
|
|
|
"food_cake_choco_texture.png",
|
|
|
|
"food_cake_choco_texture.png",
|
|
|
|
"food_cake_choco_texture_side.png",
|
|
|
|
"food_cake_choco_texture_side.png",
|
|
|
|
"food_cake_choco_texture_side.png",
|
|
|
|
"food_cake_choco_texture_side.png"
|
|
|
|
},
|
|
|
|
walkable = false,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
drawtype="nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
node_box = food.cake_box
|
2013-09-10 19:35:04 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2013-09-10 19:35:04 +02:00
|
|
|
type = "cooking",
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:cake_choco",
|
|
|
|
recipe = "food:cakemix_choco",
|
|
|
|
cooktime = 10,
|
|
|
|
})
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:cakemix_choco",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Chocolate Cake Mix"),
|
|
|
|
inventory_image = "food_cakemix_choco.png",
|
2013-09-10 19:35:04 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:cakemix_choco",
|
2013-09-10 19:35:04 +02:00
|
|
|
recipe = {
|
2014-08-27 20:30:45 +02:00
|
|
|
{"","group:food_choco_powder",""},
|
|
|
|
{"group:food_flour","group:food_sugar","group:food_egg"},
|
|
|
|
}
|
2013-09-10 19:35:04 +02:00
|
|
|
})
|
2014-08-27 20:30:45 +02:00
|
|
|
end)
|
2013-09-10 19:35:04 +02:00
|
|
|
|
2014-08-27 20:30:45 +02:00
|
|
|
food.module("cake_carrot", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_node(":food:cake_carrot", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Carrot Cake"),
|
|
|
|
on_use = food.item_eat(4),
|
|
|
|
groups={food=3,crumbly=3},
|
|
|
|
walkable = false,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
tiles = {
|
|
|
|
"food_cake_carrot_texture.png",
|
|
|
|
"food_cake_carrot_texture.png",
|
|
|
|
"food_cake_carrot_texture_side.png",
|
|
|
|
"food_cake_carrot_texture_side.png",
|
|
|
|
"food_cake_carrot_texture_side.png",
|
|
|
|
"food_cake_carrot_texture_side.png"
|
|
|
|
},
|
|
|
|
drawtype="nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
node_box = food.cake_box
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "food:cake_carrot",
|
|
|
|
recipe = "food:cakemix_carrot",
|
|
|
|
cooktime = 10,
|
|
|
|
})
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:cakemix_carrot",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Carrot Cake Mix"),
|
|
|
|
inventory_image = "food_cakemix_carrot.png",
|
2013-09-16 20:21:22 +02:00
|
|
|
})
|
2014-04-10 20:18:25 +02:00
|
|
|
food.craft({
|
2014-08-27 20:30:45 +02:00
|
|
|
output = "food:cakemix_carrot",
|
2013-09-16 20:21:22 +02:00
|
|
|
recipe = {
|
2014-08-27 20:30:45 +02:00
|
|
|
{"","group:food_carrot",""},
|
|
|
|
{"group:food_flour","group:food_sugar","group:food_egg"},
|
2013-09-16 20:21:22 +02:00
|
|
|
}
|
|
|
|
})
|
2014-08-27 20:30:45 +02:00
|
|
|
end)
|
2013-03-28 18:28:10 +01:00
|
|
|
|
2018-12-25 15:53:23 +01:00
|
|
|
minetest.log("action", "[food_basic] loaded.")
|