2014-08-27 20:30:45 +02:00
|
|
|
-- FOOD MOD
|
|
|
|
-- A mod written by rubenwardy that adds
|
|
|
|
-- food to the minetest game
|
|
|
|
-- =====================================
|
2014-11-16 13:48:24 +01:00
|
|
|
-- >> food_basic/ingredients.lua
|
2014-08-27 20:30:45 +02:00
|
|
|
-- Fallback ingredients
|
|
|
|
-- =====================================
|
|
|
|
|
2015-01-04 18:31:30 +01:00
|
|
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
|
|
|
local S = 0
|
2015-05-03 20:18:59 +02:00
|
|
|
if rawget(_G, "intllib") then
|
2015-01-04 18:31:30 +01:00
|
|
|
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
|
|
|
S = intllib.Getter(minetest.get_current_modname())
|
|
|
|
else
|
|
|
|
S = function ( s ) return s end
|
|
|
|
end
|
|
|
|
|
2014-08-27 20:30:45 +02:00
|
|
|
food.module("wheat", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:wheat", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Wheat"),
|
|
|
|
inventory_image = "food_wheat.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_wheat=1}
|
|
|
|
})
|
|
|
|
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:wheat",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"default:dry_shrub"},
|
2014-08-27 20:30:45 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("flour", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:flour", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Flour"),
|
|
|
|
inventory_image = "food_flour.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_flour = 1}
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:flour",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"group:food_wheat"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"group:food_wheat"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:flour",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"default:sand"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"default:sand"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("potato", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:potato", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Potato"),
|
|
|
|
inventory_image = "food_potato.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_potato = 1}
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:potato",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"default:dirt"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"default:apple"}
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
2014-11-16 13:38:20 +01:00
|
|
|
food.module("orange", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:orange", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Orange"),
|
|
|
|
inventory_image = "food_orange.png",
|
|
|
|
groups = {food_orange = 1}
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
output = "food:orange",
|
|
|
|
recipe = {
|
|
|
|
{"", "default:desert_sand", ""},
|
|
|
|
{"default:desert_sand", "default:desert_sand", "default:desert_sand"},
|
|
|
|
{"", "default:desert_sand", ""}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
2014-08-27 20:30:45 +02:00
|
|
|
food.module("tomato", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:tomato", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Tomato"),
|
|
|
|
inventory_image = "food_tomato.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_tomato = 1}
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:tomato",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"", "default:desert_sand", ""},
|
|
|
|
{"default:desert_sand", "", "default:desert_sand"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"", "default:desert_sand", ""}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("carrot", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:carrot", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Carrot"),
|
|
|
|
inventory_image = "food_carrot.png",
|
|
|
|
groups = {food_carrot=1},
|
2014-08-27 20:30:45 +02:00
|
|
|
on_use = food.item_eat(3)
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:carrot",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"default:apple", "default:apple", "default:apple"},
|
2014-08-27 20:30:45 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("milk", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:milk", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Milk"),
|
|
|
|
image = "food_milk.png",
|
|
|
|
on_use = food.item_eat(1),
|
|
|
|
groups = { eatable=1, food_milk = 1 },
|
2014-08-27 20:30:45 +02:00
|
|
|
stack_max=10
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:milk",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"default:sand"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"bucket:bucket_water"}
|
2014-11-16 13:38:20 +01:00
|
|
|
},
|
|
|
|
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}},
|
2014-08-27 20:30:45 +02:00
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("egg", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:egg", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Egg"),
|
|
|
|
inventory_image = "food_egg.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_egg=1}
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:egg",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"", "default:sand", ""},
|
|
|
|
{"default:sand", "", "default:sand"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"", "default:sand", ""}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("cocoa", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:cocoa", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Cocoa Bean"),
|
|
|
|
inventory_image = "food_cocoa.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_cocoa=1}
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:cocoa",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"", "default:apple", ""},
|
|
|
|
{"default:apple", "", "default:apple"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"", "default:apple", ""}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("meat", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:meat", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Venison"),
|
|
|
|
inventory_image = "food_meat.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_meat=1, food_chicken=1}
|
2014-11-16 13:38:20 +01:00
|
|
|
})
|
2014-08-27 20:30:45 +02:00
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
type = "cooking",
|
|
|
|
output = "food:meat",
|
|
|
|
recipe = "group:food_meat_raw",
|
2014-08-27 20:30:45 +02:00
|
|
|
cooktime = 30
|
|
|
|
})
|
|
|
|
|
|
|
|
if not minetest.get_modpath("animalmaterials") then
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:meat_raw", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Raw meat"),
|
|
|
|
image = "food_meat_raw.png",
|
|
|
|
on_use = food.item_eat(1),
|
|
|
|
groups = { meat=1, eatable=1, food_meat_raw=1 },
|
2014-08-27 20:30:45 +02:00
|
|
|
stack_max=25
|
|
|
|
})
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:meat_raw",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"default:apple"},
|
2014-08-27 20:30:45 +02:00
|
|
|
{"default:dirt"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("sugar", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:sugar", {
|
2014-11-16 13:38:20 +01:00
|
|
|
description = S("Sugar"),
|
|
|
|
inventory_image = "food_sugar.png",
|
2014-08-27 20:30:45 +02:00
|
|
|
groups = {food_sugar=1}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
output = "food:sugar 20",
|
2014-08-27 20:30:45 +02:00
|
|
|
recipe = {
|
2014-11-16 13:38:20 +01:00
|
|
|
{"default:papyrus"},
|
2014-08-27 20:30:45 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("chocolate_powder", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:chocolate_powder", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Chocolate Powder"),
|
|
|
|
inventory_image = "food_chocolate_powder.png",
|
|
|
|
groups = {food_choco_powder = 1}
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
output = "food:chocolate_powder 16",
|
|
|
|
recipe = {
|
|
|
|
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"},
|
|
|
|
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"},
|
|
|
|
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("pasta", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:pasta",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Pasta"),
|
|
|
|
inventory_image = "food_pasta.png",
|
|
|
|
groups = {food_pasta=1}
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
output = "food:pasta 4",
|
|
|
|
type = "shapeless",
|
|
|
|
recipe = {"group:food_flour","group:food_egg","group:food_egg"}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("bowl", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:bowl",{
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Bowl"),
|
|
|
|
inventory_image = "food_bowl.png",
|
|
|
|
groups = {food_bowl=1}
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
output = "food:bowl",
|
|
|
|
recipe = {
|
|
|
|
{"default:clay_lump","","default:clay_lump"},
|
|
|
|
{"","default:clay_lump",""}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("butter", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:butter", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Butter"),
|
|
|
|
inventory_image = "food_butter.png",
|
|
|
|
groups = {food_butter=1}
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
output = "food:butter",
|
|
|
|
recipe = {
|
|
|
|
{"group:food_milk","group:food_milk"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
food.module("cheese", function()
|
2014-11-16 14:05:15 +01:00
|
|
|
minetest.register_craftitem(":food:cheese", {
|
2014-08-27 20:30:45 +02:00
|
|
|
description = S("Cheese"),
|
|
|
|
inventory_image = "food_cheese.png",
|
|
|
|
on_use = food.item_eat(4),
|
|
|
|
groups = {food_cheese=1}
|
|
|
|
})
|
|
|
|
food.craft({
|
|
|
|
output = "food:cheese",
|
|
|
|
recipe = {
|
|
|
|
{"group:food_butter","group:food_butter"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end, true)
|
|
|
|
|
|
|
|
if (minetest.get_modpath("animalmaterials") and not minetest.get_modpath("mobfcooking")) then
|
|
|
|
food.craft({
|
2014-11-16 13:38:20 +01:00
|
|
|
type = "cooking",
|
|
|
|
output = "food:meat",
|
|
|
|
recipe = "animalmaterials:meat_raw",
|
2014-08-27 20:30:45 +02:00
|
|
|
cooktime = 30
|
|
|
|
})
|
|
|
|
end
|