food/init.lua

688 lines
17 KiB
Lua
Raw Normal View History

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
-- =====================================
2013-09-05 20:12:08 +02:00
-- >> food/init.lua
-- The support api for the mod, and some
-- basic foods
2013-03-28 18:28:10 +01:00
-- =====================================
2014-04-13 20:10:36 +02:00
print("Food Mod - Version 2.2")
2014-04-10 20:18:25 +02:00
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (intllib) then
2014-04-10 20:18:25 +02:00
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
2014-04-10 20:18:25 +02:00
S = function ( s ) return s end
end
2013-09-16 20:21:22 +02:00
food = {
2014-02-05 10:29:25 +01:00
supported = {},
atsup = {},
df = {},
2014-04-10 20:26:42 +02:00
debug = false,
2014-04-13 20:10:36 +02:00
version = 2.2
2013-09-16 20:21:22 +02:00
}
2014-04-10 20:18:25 +02:00
-- Checks for external content, and adds support
2013-09-05 20:12:08 +02:00
function food.support(group,mod,item)
2013-09-16 20:21:22 +02:00
food.atsup[group] = true
2013-09-05 20:12:08 +02:00
if not minetest.get_modpath(mod) then
2014-04-10 20:18:25 +02:00
if food.debug then
print("[FOOD MOD DEBUG] mod '"..mod.."' is not installed")
end
2013-09-05 20:12:08 +02:00
return
end
local data = minetest.registered_items[item]
if not data then
2014-04-10 20:18:25 +02:00
print("[FOOD MOD WARNING] item '"..item.."' not found")
2013-09-05 20:12:08 +02:00
return
end
2013-03-28 18:28:10 +01:00
-- Need to copy this table, not modify it in place, otherwise it can change
-- the groups for ALL craftitems that use the default groups.
g = {}
for k, v in pairs(data.groups) do
g[k] = v
2013-09-05 20:12:08 +02:00
end
g["food_"..group] = 1
minetest.override_item(item, {groups = g})
2013-09-16 20:21:22 +02:00
food.supported[group] = true
2013-09-05 20:12:08 +02:00
end
2014-04-10 20:18:25 +02:00
-- Defines built in items if needed
2013-09-05 20:12:08 +02:00
function food.asupport(group,add)
2013-09-16 20:21:22 +02:00
food.df[group] = true
2013-09-05 20:12:08 +02:00
if food.supported[group] then
return
end
2013-03-28 18:28:10 +01:00
2013-09-05 20:12:08 +02:00
for name, def in pairs(minetest.registered_items) do
2014-04-08 19:54:35 +02:00
local g = def.groups and def.groups["food_"..group] or 0
2013-09-05 20:12:08 +02:00
if g > 0 then
return
end
end
2014-04-10 20:18:25 +02:00
if food.debug then
print("registering "..group.." inbuilt definition")
end
2013-09-05 20:12:08 +02:00
add()
end
2014-04-10 20:18:25 +02:00
-- Checks for hunger mods to register food on
2013-09-10 19:35:04 +02:00
function food.item_eat(amt)
2014-04-13 20:10:36 +02:00
if minetest.get_modpath("diet") then
return diet.item_eat(amt)
elseif minetest.get_modpath("hud") then
2013-09-20 13:09:16 +02:00
return hud.item_eat(amt)
2013-09-10 19:35:04 +02:00
else
return minetest.item_eat(amt)
end
end
2013-03-28 18:28:10 +01:00
2014-04-10 20:18:25 +02:00
-- Registers craft item or node depending on settings
function food.register(name,data,mod)
if (minetest.setting_getbool("food_use_2d") or (mod ~= nil and minetest.setting_getbool("food_"..mod.."_use_2d"))) then
minetest.register_craftitem(name,{
description = data.description,
inventory_image = data.inventory_image,
groups = data.groups,
on_use = data.on_use
})
else
local newdata = {
description = data.description,
tiles = data.tiles,
groups = data.groups,
on_use = data.on_use,
walkable = false,
sunlight_propagates = true,
drawtype = "nodebox",
2014-04-10 20:18:25 +02:00
paramtype = "light",
node_box = data.node_box
}
if (minetest.setting_getbool("food_2d_inv_image")) then
newdata.inventory_image = data.inventory_image
end
minetest.register_node(name,newdata)
end
end
-- Allows for overriding in the future
function food.craft(craft)
minetest.register_craft(craft)
end
-- Debug to check all supports have in built version, etc
2013-09-16 20:21:22 +02:00
if food.debug then
minetest.after(0, function()
for name, val in pairs(food.atsup) do
if not food.df[name] then
2014-04-10 20:18:25 +02:00
print("[FOOD MOD DEBUG] Ingredient "..name.." has no built in equiv")
2013-09-16 20:21:22 +02:00
end
end
for name, val in pairs(food.df) do
if not food.atsup[name] then
2014-04-10 20:18:25 +02:00
print("[FOOD MOD DEBUG] Inbuilt ingredient "..name.." has no supported external equiv")
2013-09-16 20:21:22 +02:00
end
end
end)
end
2013-09-05 20:12:08 +02:00
-- Add support for other mods
local function _meat(type,mod,item)
food.support(type,mod,item)
food.support("meat",mod,item)
end
2013-09-05 20:12:08 +02:00
food.support("wheat","farming","farming:wheat")
food.support("flour","farming","farming:flour")
2013-09-16 20:21:22 +02:00
food.support("potato","docfarming","docfarming:potato")
2013-10-17 20:12:33 +02:00
food.support("potato","veggies","veggies:potato")
2014-04-06 20:30:10 +02:00
food.support("potato","farming_plus","farming_plus:potato_item")
2013-09-05 20:12:08 +02:00
food.support("tomato","farming_plus","farming_plus:tomato_item")
food.support("tomato","plantlib","plantlib:tomato")
food.support("carrot","farming_plus","farming_plus:carrot_item")
food.support("carrot","docfarming","docfarming:carrot")
food.support("carrot","plantlib","plantlib:carrot")
2013-09-25 14:08:41 +02:00
food.support("carrot","jkfarming","jkfarming:carrot")
2013-09-05 20:12:08 +02:00
food.support("cocoa","farming_plus","farming_plus:cocoa_bean")
food.support("milk","animalmaterials","animalmaterials:milk")
food.support("milk","my_mobs","my_mobs:milk_glass_cup")
2013-09-25 14:08:41 +02:00
food.support("milk","jkanimals","jkanimals:bucket_milk")
2013-09-05 20:12:08 +02:00
food.support("egg","animalmaterials","animalmaterials:egg")
food.support("egg","animalmaterials","animalmaterials:egg_big")
2013-09-25 14:08:41 +02:00
food.support("egg","jkanimals","jkanimals:egg")
2013-09-10 19:35:04 +02:00
food.support("meat_raw","animalmaterials","animalmaterials:meat_raw")
food.support("meat","mobs","mobs:meat")
2013-09-25 14:08:41 +02:00
food.support("meat","jkanimals","jkanimals:meat")
_meat("pork","mobfcooking","mobfcooking:cooked_pork")
_meat("beef","mobfcooking","mobfcooking:cooked_beef")
_meat("chicken","mobfcooking","mobfcooking:cooked_chicken")
_meat("lamb","mobfcooking","mobfcooking:cooked_lamb")
_meat("venison","mobfcooking","mobfcooking:cooked_venison")
2013-09-16 20:21:22 +02:00
food.support("cup","vessels","vessels:drinking_glass")
2013-09-25 14:08:41 +02:00
food.support("sugar","jkfarming","jkfarming:sugar")
2014-03-16 11:20:34 +01:00
food.support("sugar","bushes_classic","bushes:sugar")
2013-03-28 18:28:10 +01:00
2013-09-05 20:12:08 +02:00
-- Default inbuilt ingrediants
food.asupport("wheat",function()
minetest.register_craftitem("food:wheat", {
description = S("Wheat"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_wheat.png",
groups = {food_wheat=1}
})
2013-03-28 18:28:10 +01:00
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:wheat",
recipe = {
{"default:dry_shrub"},
}
})
end)
food.asupport("flour",function()
minetest.register_craftitem("food:flour", {
description = S("Flour"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_flour.png",
groups = {food_flour = 1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:flour",
recipe = {
{"group:food_wheat"},
{"group:food_wheat"}
}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:flour",
recipe = {
{"default:sand"},
{"default:sand"}
}
})
end)
2013-09-16 20:21:22 +02:00
food.asupport("potato",function()
minetest.register_craftitem("food:potato", {
description = S("Potato"),
2013-09-16 20:21:22 +02:00
inventory_image = "food_potato.png",
2014-02-05 10:29:25 +01:00
groups = {food_potato = 1}
2013-09-16 20:21:22 +02:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-16 20:21:22 +02:00
output = "food:potato",
recipe = {
{"default:dirt"},
{"default:apple"}
}
})
end)
2013-09-05 20:12:08 +02:00
food.asupport("tomato",function()
minetest.register_craftitem("food:tomato", {
description = S("Tomato"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_tomato.png",
groups = {food_tomato = 1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:tomato",
recipe = {
{"", "default:desert_sand", ""},
{"default:desert_sand", "", "default:desert_sand"},
{"", "default:desert_sand", ""}
}
})
end)
food.asupport("carrot",function()
minetest.register_craftitem("food:carrot", {
description = S("Carrot"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_carrot.png",
groups = {food_carrot=1},
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(3)
2013-09-05 20:12:08 +02:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:carrot",
recipe = {
{"default:apple","default:apple","default:apple"},
}
})
end)
food.asupport("milk",function()
minetest.register_craftitem("food:milk", {
description = S("Milk"),
2013-09-05 20:12:08 +02:00
image = "food_milk.png",
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(1),
2013-09-05 20:12:08 +02:00
groups = { eatable=1, food_milk = 1 },
stack_max=10
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:milk",
recipe = {
{"default:sand"},
{"bucket:bucket_water"}
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}},
})
end)
food.asupport("egg",function()
minetest.register_craftitem("food:egg",{
description = S("Egg"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_egg.png",
groups = {food_egg=1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:egg",
recipe = {
{"", "default:sand", ""},
{"default:sand", "", "default:sand"},
{"", "default:sand", ""}
}
})
end)
food.asupport("cocoa",function()
minetest.register_craftitem("food:cocoa", {
description = S("Cocoa Bean"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_cocoa.png",
groups = {food_cocoa=1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:cocoa",
recipe = {
{"","default:apple",""},
{"default:apple","","default:apple"},
{"","default:apple",""}
}
})
end)
2013-09-10 19:35:04 +02:00
food.asupport("meat_raw",function()
minetest.register_craftitem("food:meat_raw", {
description = S("Raw meat"),
2013-09-10 19:35:04 +02:00
image = "food_meat_raw.png",
on_use = food.item_eat(1),
groups = { meat=1, eatable=1, food_meat_raw=1 },
stack_max=25
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-10 19:35:04 +02:00
output = "food:meat_raw",
recipe = {
{"default:apple"},
{"default:dirt"}
}
})
end)
2013-09-16 20:21:22 +02:00
food.asupport("meat",function()
2013-09-10 19:35:04 +02:00
minetest.register_craftitem("food:meat", {
description = S("Venison"),
2013-09-10 19:35:04 +02:00
inventory_image = "food_meat.png",
groups = {food_meat=1,food_chicken=1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-10 19:35:04 +02:00
type = "cooking",
output = "food:meat",
recipe = "group:food_meat_raw",
cooktime = 30
})
end)
food.asupport("sugar",function()
minetest.register_craftitem("food:sugar", {
description = S("Sugar"),
inventory_image = "food_sugar.png",
groups = {food_sugar=1}
})
minetest.register_craft({
output = "food:sugar 20",
recipe = {
{"default:papyrus"},
}
})
end)
2013-03-28 18:28:10 +01:00
if (minetest.get_modpath("animalmaterials") and not minetest.get_modpath("mobfcooking")) then
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-16 20:21:22 +02:00
type = "cooking",
output = "food:meat",
2013-09-16 20:21:22 +02:00
recipe = "group:food_meat_raw",
cooktime = 30
})
end
2013-09-05 20:12:08 +02:00
-- Register chocolate powder
minetest.register_craftitem("food:chocolate_powder", {
description = S("Chocolate Powder"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_chocolate_powder.png",
groups = {food_choco_powder = 1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
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"}
}
2013-03-28 18:28:10 +01:00
})
2013-09-05 20:12:08 +02:00
-- Register dark chocolate
minetest.register_craftitem("food:dark_chocolate",{
description = S("Dark Chocolate"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_dark_chocolate.png",
on_use = food.item_eat(3),
2013-09-05 20:12:08 +02:00
groups = {food_dark_chocolate=1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:dark_chocolate",
2013-03-28 18:28:10 +01:00
recipe = {
2013-09-05 20:12:08 +02:00
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"}
2013-03-28 18:28:10 +01:00
}
})
2013-09-05 20:12:08 +02:00
-- Register milk chocolate
minetest.register_craftitem("food:milk_chocolate",{
description = S("Milk Chocolate"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_milk_chocolate.png",
on_use = food.item_eat(3),
2013-09-05 20:12:08 +02:00
groups = {food_milk_chocolate=1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:milk_chocolate",
recipe = {
{"","group:food_milk",""},
{"group:food_cocoa","group:food_cocoa","group:food_cocoa"}
}
2013-03-28 18:28:10 +01:00
})
2013-09-05 20:12:08 +02:00
-- Register pasta
minetest.register_craftitem("food:pasta",{
description = S("Pasta"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_pasta.png",
groups = {food_pasta=1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:pasta 4",
type = "shapeless",
recipe = {"group:food_flour","group:food_egg","group:food_egg"}
})
2013-03-28 18:28:10 +01:00
2013-09-05 20:12:08 +02:00
-- Register bowl
2013-03-28 18:28:10 +01:00
minetest.register_craftitem("food:bowl",{
description = S("Bowl"),
2013-03-28 18:28:10 +01:00
inventory_image = "food_bowl.png",
2013-09-05 20:12:08 +02:00
groups = {food_bowl=1}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-10 19:35:04 +02:00
output = "food:bowl",
recipe = {
{"default:clay_lump","","default:clay_lump"},
{"","default:clay_lump",""}
}
})
2013-09-05 20:12:08 +02:00
-- Register butter
minetest.register_craftitem("food:butter", {
description = S("Butter"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_butter.png",
groups = {food_butter=1}
2013-03-28 18:28:10 +01:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:butter",
2013-08-01 11:56:27 +02:00
recipe = {
2013-09-05 20:12:08 +02:00
{"group:food_milk","group:food_milk"},
2013-08-01 11:56:27 +02:00
}
})
2013-09-05 20:12:08 +02:00
-- Register cheese
minetest.register_craftitem("food:cheese", {
description = S("Cheese"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_cheese.png",
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(4),
2013-09-05 20:12:08 +02:00
groups = {food_cheese=1}
2013-03-28 18:28:10 +01:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:cheese",
2013-03-28 18:28:10 +01:00
recipe = {
2013-09-05 20:12:08 +02:00
{"group:food_butter","group:food_butter"},
2013-03-28 18:28:10 +01:00
}
})
2013-09-16 20:21:22 +02:00
-- Register baked potato
minetest.register_craftitem("food:baked_potato", {
description = S("Baked Potato"),
2013-09-16 20:21:22 +02:00
inventory_image = "food_baked_potato.png",
on_use = food.item_eat(6),
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-16 20:21:22 +02:00
type = "cooking",
output = "food:baked_potato",
recipe = "group:food_potato",
})
2013-09-05 20:12:08 +02:00
-- Register pasta bake
minetest.register_craftitem("food:pasta_bake",{
description = S("Pasta Bake"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_pasta_bake.png",
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(4),
2013-09-05 20:12:08 +02:00
groups = {food=3}
})
minetest.register_craftitem("food:pasta_bake_raw",{
description = S("Raw Pasta Bake"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_pasta_bake_raw.png",
2013-03-28 18:28:10 +01:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:pasta_bake",
type = "cooking",
recipe = "food:pasta_bake_raw"
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:pasta_bake_raw",
recipe = {
{"group:food_cheese"},
{"group:food_pasta"},
{"group:food_bowl"}
}
})
2013-03-28 18:28:10 +01:00
2013-09-16 20:21:22 +02:00
-- Register Soups
2014-04-08 19:54:35 +02:00
local soups = {
{"tomato","tomato"},
{"chicken","meat"}
}
2013-09-10 19:35:04 +02:00
for i=1, #soups do
local flav = soups[i]
2014-04-08 19:54:35 +02:00
minetest.register_craftitem("food:soup_"..flav[1],{
description = S(flav[1].." Soup"),
inventory_image = "food_soup_"..flav[1]..".png",
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(4),
groups = {food=3}
})
2014-04-08 19:54:35 +02:00
minetest.register_craftitem("food:soup_"..flav[1].."_raw",{
description = S("Uncooked ".. flav[1].." Soup"),
inventory_image = "food_soup_"..flav[1].."_raw.png",
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-04-08 19:54:35 +02:00
output = "food:soup_"..flav[1],
recipe = "food:soup_"..flav[1].."_raw",
2013-09-10 19:35:04 +02:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2014-04-08 19:54:35 +02:00
output = "food:soup_"..flav[1].."_raw",
2013-09-10 19:35:04 +02:00
recipe = {
{"", "", ""},
2014-04-08 19:54:35 +02:00
{"bucket:bucket_water", "group:food_"..flav[2], "bucket:bucket_water"},
2013-09-10 19:35:04 +02:00
{"", "group:food_bowl", ""},
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"},{"bucket:bucket_water", "bucket:bucket_empty"}}
})
end
2013-09-16 20:21:22 +02:00
-- Juices
local juices = {"apple","cactus"}
for i=1, #juices do
local flav = juices[i]
minetest.register_craftitem("food:"..flav.."_juice", {
2014-03-11 12:46:06 +01:00
description = S(flav.." Juice"),
2013-09-16 20:21:22 +02:00
inventory_image = "food_"..flav.."_juice.png",
on_use = food.item_eat(2),
2013-09-16 20:21:22 +02:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-16 20:21:22 +02:00
output = "food:"..flav.."_juice 4",
recipe = {
{"","",""},
{"","default:"..flav,""},
{"","group:food_cup",""},
}
})
end
minetest.register_craftitem("food:rainbow_juice", {
description = S("Rainbow Juice"),
2013-09-16 20:21:22 +02:00
inventory_image = "food_rainbow_juice.png",
on_use = food.item_eat(20),
2013-09-16 20:21:22 +02:00
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-16 20:21:22 +02:00
output = "food:rainbow_juice 99",
recipe = {
{"","",""},
{"","default:nyancat_rainbow",""},
{"","group:food_cup",""},
}
})
2013-09-05 20:12:08 +02:00
-- Register cakes
minetest.register_node("food:cake", {
description = S("Cake"),
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(4),
2013-09-05 20:12:08 +02:00
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 = {
type = "fixed",
fixed = {
{-0.250000,-0.500000,-0.296880,0.250000,-0.250000,0.312502}, --NodeBox 1
{-0.309375,-0.500000,-0.250000,0.309375,-0.250000,0.250000}, --NodeBox 2
{-0.250000,-0.250000,-0.250000,0.250000,-0.200000,0.250000}, --NodeBox 3
}
}
})
minetest.register_node("food:cake_choco", {
description = S("Chocolate Cake"),
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(4),
2013-09-05 20:12:08 +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 = {
type = "fixed",
fixed = {
{-0.250000,-0.500000,-0.296880,0.250000,-0.250000,0.312502}, --NodeBox 1
{-0.309375,-0.500000,-0.250000,0.309375,-0.250000,0.250000}, --NodeBox 2
{-0.250000,-0.250000,-0.250000,0.250000,-0.200000,0.250000}, --NodeBox 3
}
}
})
minetest.register_node("food:cake_carrot", {
description = S("Carrot Cake"),
2013-09-10 19:35:04 +02:00
on_use = food.item_eat(4),
2013-09-05 20:12:08 +02:00
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 = {
type = "fixed",
fixed = {
{-0.250000,-0.500000,-0.296880,0.250000,-0.250000,0.312502}, --NodeBox 1
{-0.309375,-0.500000,-0.250000,0.309375,-0.250000,0.250000}, --NodeBox 2
{-0.250000,-0.250000,-0.250000,0.250000,-0.200000,0.250000}, --NodeBox 3
}
2013-03-28 18:28:10 +01:00
}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
type = "cooking",
output = "food:cake",
recipe = "food:cakemix_plain",
cooktime = 10,
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
type = "cooking",
output = "food:cake_choco",
recipe = "food:cakemix_choco",
cooktime = 10,
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
type = "cooking",
output = "food:cake_carrot",
recipe = "food:cakemix_carrot",
cooktime = 10,
})
-- Cake mix
minetest.register_craftitem("food:cakemix_plain",{
description = S("Cake Mix"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_cakemix_plain.png",
})
minetest.register_craftitem("food:cakemix_choco",{
description = S("Chocolate Cake Mix"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_cakemix_choco.png",
})
2013-03-28 18:28:10 +01:00
2013-09-05 20:12:08 +02:00
minetest.register_craftitem("food:cakemix_carrot",{
description = S("Carrot Cake Mix"),
2013-09-05 20:12:08 +02:00
inventory_image = "food_cakemix_carrot.png",
})
minetest.register_craft({
output = "food:cakemix_plain",
recipe = {
{"group:food_flour","group:food_sugar","group:food_egg"},
}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:cakemix_choco",
recipe = {
{"","group:food_choco_powder",""},
{"group:food_flour","group:food_sugar","group:food_egg"},
}
})
2014-04-10 20:18:25 +02:00
food.craft({
2013-09-05 20:12:08 +02:00
output = "food:cakemix_carrot",
recipe = {
{"","group:food_carrot",""},
{"group:food_flour","group:food_sugar","group:food_egg"},
}
})