Updated food mod and added its items in hud/hunger.lua

- Updated food mod (now splitted between food, containing the API, and food_basic, containing the items/craft recipes)
 - Added food's items un hud/hunger.lua
This commit is contained in:
LeMagnesium 2015-05-02 15:13:40 +02:00
parent baa7b8875b
commit 41a4945ff2
61 changed files with 488 additions and 330 deletions

6
mods/food/README.md Executable file → Normal file
View File

@ -1,5 +1,5 @@
The Food Mod
============
Food
====
This is the main mod in the food mod collection.
@ -37,6 +37,8 @@ Exceptions:
* Baked potato texture by Doc, WTFPL
* Dough, flour and wheat textures from default farming mod, WTFPL
* Orange from farming_plus, WTFPL
* Egg and milk textures from Mobf, CC BY SA
* Orange juice texture by CiaranG (modified from rubenwardy's apple juice texture)
Have I missed out credit? Please tell me.

0
mods/food/description.txt Executable file → Normal file
View File

View File

@ -0,0 +1,4 @@
diet?
hud?
intllib?
hbhunger?

View File

@ -0,0 +1 @@
(API framework) The largest supporting food mod for Minetest. Adds soups, cakes, bakes and juices.

View File

@ -6,15 +6,6 @@
-- The supporting api for the mod
-- =====================================
-- Boilerplate to support localized strings if intllib mod is installed.
S = 0
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
food = {
modules = {},
disabled_modules = {},
@ -70,7 +61,7 @@ function food.support(group, item)
minetest.override_item(item, {groups = g})
end
function food.disable(name)
function food.disable(name)
if type(name) == "table" then
for i = 1, #name do
food.disable(name[i])
@ -99,7 +90,7 @@ function food.module(name, func, ingred)
return
end
end
if food.debug then
print("[Food Debug] Registering " .. name .. " fallback definition")
end
@ -111,10 +102,16 @@ end
-- Checks for hunger mods to register food on
function food.item_eat(amt)
if minetest.get_modpath("diet") then
if minetest.get_modpath("diet") and diet and diet.item_eat then
return diet.item_eat(amt)
elseif minetest.get_modpath("hunger") then
return hunger.item_eat(amt)
elseif minetest.get_modpath("hud") and hud and hud.item_eat then
return hud.item_eat(amt)
elseif minetest.get_modpath("hphunger") then
if hphunger then
return hphunger.item_eat(amt)
else
return hunger.item_eat(amt)
end
else
return minetest.item_eat(amt)
end

View File

@ -0,0 +1,42 @@
The Food Mod
============
This is the main mod in the food mod collection.
Version 2.3
The Aims
--------
All content should follow these aims:
* Basis for expansion - supplies a framework of ingredients for other mods to build upon
* Mod support without dependancies - this allows flexibility for the user
* Minetest-game worthy - (Minimalism) This mod only contains traditional foods - such as cakes, soups and bread.
Documentation
-------------
Recipe guide: https://www.dropbox.com/s/tsvjmobv9n3isu0/food_crafting.pdf?dl=1
Expansion Packs
---------------
There are expansion mods available. Just install them in a mod folder, and everything should be fine.
* Sweet Foods - https://github.com/rubenwardy/food_sweet
* Modern food (Needs updating) - burgers, soft drinks, pop corn, coffee, etc
Licensing
---------
Created by rubenwardy
License for code: GPL 3.0 or later.
License for textures: CC-BY-SA
Exceptions:
* Baked potato texture by Doc, WTFPL
* Dough, flour and wheat textures from default farming mod, WTFPL
* Egg and milk textures from Mobf, CC BY SA
Have I missed out credit? Please tell me.

View File

@ -1,11 +1,10 @@
food
animalmaterials?
bushes_classic?
default?
docfarming?
diet?
farming?
farming_plus?
hud?
intllib?
jkanimals?
jkfarming?

View File

@ -0,0 +1 @@
The largest supporting food mod for Minetest. Adds soups, cakes, bakes and juices.

View File

@ -0,0 +1,287 @@
-- FOOD MOD
-- A mod written by rubenwardy that adds
-- food to the minetest game
-- =====================================
-- >> food_basic/ingredients.lua
-- Fallback ingredients
-- =====================================
-- Boilerplate to support localized strings if intllib mod is installed.
local S = 0
if (intllib) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
food.module("wheat", function()
minetest.register_craftitem(":food:wheat", {
description = S("Wheat"),
inventory_image = "food_wheat.png",
groups = {food_wheat=1}
})
food.craft({
output = "food:wheat",
recipe = {
{"default:dry_shrub"},
}
})
end, true)
food.module("flour", function()
minetest.register_craftitem(":food:flour", {
description = S("Flour"),
inventory_image = "food_flour.png",
groups = {food_flour = 1}
})
food.craft({
output = "food:flour",
recipe = {
{"group:food_wheat"},
{"group:food_wheat"}
}
})
end, true)
food.module("potato", function()
minetest.register_craftitem(":food:potato", {
description = S("Potato"),
inventory_image = "food_potato.png",
groups = {food_potato = 1}
})
food.craft({
output = "food:potato",
recipe = {
{"default:dirt"},
{"default:apple"}
}
})
end, true)
food.module("orange", function()
minetest.register_craftitem(":food:orange", {
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)
food.module("tomato", function()
minetest.register_craftitem(":food:tomato", {
description = S("Tomato"),
inventory_image = "food_tomato.png",
groups = {food_tomato = 1}
})
food.craft({
output = "food:tomato",
recipe = {
{"", "default:desert_sand", ""},
{"default:desert_sand", "", "default:desert_sand"},
{"", "default:desert_sand", ""}
}
})
end, true)
food.module("carrot", function()
minetest.register_craftitem(":food:carrot", {
description = S("Carrot"),
inventory_image = "food_carrot.png",
groups = {food_carrot=1},
on_use = food.item_eat(3)
})
food.craft({
output = "food:carrot",
recipe = {
{"default:apple", "default:apple", "default:apple"},
}
})
end, true)
food.module("milk", function()
minetest.register_craftitem(":food:milk", {
description = S("Milk"),
image = "food_milk.png",
on_use = food.item_eat(1),
groups = { eatable=1, food_milk = 1 },
stack_max=10
})
food.craft({
output = "food:milk",
recipe = {
{"default:sand"},
{"bucket:bucket_water"}
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}},
})
end, true)
food.module("egg", function()
minetest.register_craftitem(":food:egg", {
description = S("Egg"),
inventory_image = "food_egg.png",
groups = {food_egg=1}
})
food.craft({
output = "food:egg",
recipe = {
{"", "default:sand", ""},
{"default:sand", "", "default:sand"},
{"", "default:sand", ""}
}
})
end, true)
food.module("cocoa", function()
minetest.register_craftitem(":food:cocoa", {
description = S("Cocoa Bean"),
inventory_image = "food_cocoa.png",
groups = {food_cocoa=1}
})
food.craft({
output = "food:cocoa",
recipe = {
{"", "default:apple", ""},
{"default:apple", "", "default:apple"},
{"", "default:apple", ""}
}
})
end, true)
food.module("meat", function()
minetest.register_craftitem(":food:meat", {
description = S("Venison"),
inventory_image = "food_meat.png",
groups = {food_meat=1, food_chicken=1}
})
food.craft({
type = "cooking",
output = "food:meat",
recipe = "group:food_meat_raw",
cooktime = 30
})
if not minetest.get_modpath("animalmaterials") then
minetest.register_craftitem(":food:meat_raw", {
description = S("Raw meat"),
image = "food_meat_raw.png",
on_use = food.item_eat(1),
groups = { meat=1, eatable=1, food_meat_raw=1 },
stack_max=25
})
food.craft({
output = "food:meat_raw",
recipe = {
{"default:apple"},
{"default:dirt"}
}
})
end
end, true)
food.module("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, true)
food.module("chocolate_powder", function()
minetest.register_craftitem(":food:chocolate_powder", {
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()
minetest.register_craftitem(":food:pasta",{
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()
minetest.register_craftitem(":food:bowl",{
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()
minetest.register_craftitem(":food:butter", {
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()
minetest.register_craftitem(":food:cheese", {
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({
type = "cooking",
output = "food:meat",
recipe = "animalmaterials:meat_raw",
cooktime = 30
})
end

View File

@ -2,21 +2,27 @@
-- A mod written by rubenwardy that adds
-- food to the minetest game
-- =====================================
-- >> food/init.lua
-- >> food_basic/init.lua
-- Some basic foods
-- =====================================
print("Food Mod - Version 2.3")
dofile(minetest.get_modpath("food").."/api.lua")
dofile(minetest.get_modpath("food").."/support.lua")
dofile(minetest.get_modpath("food").."/ingredients.lua")
dofile(minetest.get_modpath("food_basic").."/support.lua")
dofile(minetest.get_modpath("food_basic").."/ingredients.lua")
-- Boilerplate to support localized strings if intllib mod is installed.
local S = 0
if (intllib) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
-- Register dark chocolate
food.module("dark_chocolate", function()
minetest.register_craftitem("food:dark_chocolate",{
minetest.register_craftitem(":food:dark_chocolate",{
description = S("Dark Chocolate"),
inventory_image = "food_dark_chocolate.png",
on_use = food.item_eat(3),
@ -32,7 +38,7 @@ end)
-- Register milk chocolate
food.module("milk_chocolate", function()
minetest.register_craftitem("food:milk_chocolate",{
minetest.register_craftitem(":food:milk_chocolate",{
description = S("Milk Chocolate"),
inventory_image = "food_milk_chocolate.png",
on_use = food.item_eat(3),
@ -49,7 +55,7 @@ end)
-- Register baked potato
food.module("baked_potato", function()
minetest.register_craftitem("food:baked_potato", {
minetest.register_craftitem(":food:baked_potato", {
description = S("Baked Potato"),
inventory_image = "food_baked_potato.png",
on_use = food.item_eat(6),
@ -63,13 +69,13 @@ end)
-- Register pasta bake
food.module("pasta_bake", function()
minetest.register_craftitem("food:pasta_bake",{
minetest.register_craftitem(":food:pasta_bake",{
description = S("Pasta Bake"),
inventory_image = "food_pasta_bake.png",
on_use = food.item_eat(4),
groups = {food=3}
})
minetest.register_craftitem("food:pasta_bake_raw",{
minetest.register_craftitem(":food:pasta_bake_raw",{
description = S("Raw Pasta Bake"),
inventory_image = "food_pasta_bake_raw.png",
})
@ -96,16 +102,16 @@ local soups = {
for i=1, #soups do
local flav = soups[i]
food.module("soup_"..flav[1], function()
minetest.register_craftitem("food:soup_"..flav[1],{
minetest.register_craftitem(":food:soup_"..flav[1],{
description = S(flav[1].." Soup"),
inventory_image = "food_soup_"..flav[1]..".png",
on_use = food.item_eat(4),
groups = {food=3}
})
minetest.register_craftitem("food:soup_"..flav[1].."_raw",{
minetest.register_craftitem(":food:soup_"..flav[1].."_raw",{
description = S("Uncooked ".. flav[1].." Soup"),
inventory_image = "food_soup_"..flav[1].."_raw.png",
})
food.craft({
type = "cooking",
@ -125,20 +131,20 @@ for i=1, #soups do
end
-- Juices
local juices = {"apple","cactus"}
local juices = {"apple", "orange", "cactus"}
for i=1, #juices do
local flav = juices[i]
food.module(flav.."_juice", function()
minetest.register_craftitem("food:"..flav.."_juice", {
minetest.register_craftitem(":food:"..flav.."_juice", {
description = S(flav.." Juice"),
inventory_image = "food_"..flav.."_juice.png",
on_use = food.item_eat(2),
})
})
food.craft({
output = "food:"..flav.."_juice 4",
recipe = {
{"","",""},
{"","default:"..flav,""},
{"","group:food_"..flav,""},
{"","group:food_cup",""},
}
})
@ -146,7 +152,7 @@ for i=1, #juices do
end
food.module("rainbow_juice", function()
minetest.register_craftitem("food:rainbow_juice", {
minetest.register_craftitem(":food:rainbow_juice", {
description = S("Rainbow Juice"),
inventory_image = "food_rainbow_juice.png",
on_use = food.item_eat(20),
@ -173,7 +179,7 @@ food.cake_box = {
-- Register cakes
food.module("cake", function()
minetest.register_node("food:cake", {
minetest.register_node(":food:cake", {
description = S("Cake"),
on_use = food.item_eat(4),
groups={food=3,crumbly=3},
@ -197,7 +203,7 @@ food.module("cake", function()
recipe = "food:cakemix_plain",
cooktime = 10,
})
minetest.register_craftitem("food:cakemix_plain",{
minetest.register_craftitem(":food:cakemix_plain",{
description = S("Cake Mix"),
inventory_image = "food_cakemix_plain.png",
})
@ -211,7 +217,7 @@ end)
food.module("cake_choco", function()
minetest.register_node("food:cake_choco", {
minetest.register_node(":food:cake_choco", {
description = S("Chocolate Cake"),
on_use = food.item_eat(4),
groups={food=3,crumbly=3},
@ -235,7 +241,7 @@ food.module("cake_choco", function()
recipe = "food:cakemix_choco",
cooktime = 10,
})
minetest.register_craftitem("food:cakemix_choco",{
minetest.register_craftitem(":food:cakemix_choco",{
description = S("Chocolate Cake Mix"),
inventory_image = "food_cakemix_choco.png",
})
@ -249,7 +255,7 @@ food.module("cake_choco", function()
end)
food.module("cake_carrot", function()
minetest.register_node("food:cake_carrot", {
minetest.register_node(":food:cake_carrot", {
description = S("Carrot Cake"),
on_use = food.item_eat(4),
groups={food=3,crumbly=3},
@ -273,7 +279,7 @@ food.module("cake_carrot", function()
recipe = "food:cakemix_carrot",
cooktime = 10,
})
minetest.register_craftitem("food:cakemix_carrot",{
minetest.register_craftitem(":food:cakemix_carrot",{
description = S("Carrot Cake Mix"),
inventory_image = "food_cakemix_carrot.png",
})

View File

@ -5,6 +5,7 @@ Flour = Mehl
Potato = Kartoffel
Tomato = Tomate
Carrot = Karotte
Orange =
Milk = Milch
Egg = Ei
Cocoa Bean = Kakaobohne

View File

@ -0,0 +1,40 @@
# Traduction française / French translation
Wheat = Blé
Flour = Farine
Potato = Patate
Tomato = Tomate
Carrot = Carotte
Orange = Orange
Milk = Lait
Egg = Oeuf
Cocoa Bean = Fève de caco
Raw meat = Viande crue
Venison = Venaison
Sugar = Sucre
Chocolate Powder = Poudre de chocolat
Dark Chocolate = Chocolat noir
Milk Chocolate = Chocolat blanc
Pasta = Pâtes
Bowl = Bol
Butter = Beurre
Cheese = Fromage
Baked Potato = Patate cuite
Pasta Bake = Plat de pâtes
Raw Pasta Bake = Plat de pâtes crues
chicken Soup = Soupe de poulet
tomato Soup = Soupe de tomate
Uncooked tomato Soup = Soupe de tomate crue
Uncooked chicken Soup = Soupe de poulet crue
apple Juice = Jus de pomme
cactus Juice = Jus de cactus
Rainbow Juice = Jus d'arc-en-ciel
Orange Juice = Jus d'orange
Cake = Gâteau
Chocolate Cake = Gâteau au chocolat
Carrot Cake = Gâteau à la carotte
Cheese cake = Gâteau au fromage
Cake Mix = Pâte pour gâteau
Chocolate Cake Mix = Pâte pour gâteau au chocolat
Carrot Cake Mix = Pâte pour gâteau à la carotte
Cheese Cake Mix = Pâte pour gâteau au fromage

View File

@ -0,0 +1,40 @@
# template
Wheat =
Flour =
Potato =
Tomato =
Carrot =
Orange =
Milk =
Egg =
Cocoa Bean =
Raw meat =
Venison =
Sugar =
Chocolate Powder =
Dark Chocolate =
Milk Chocolate =
Pasta =
Bowl =
Butter =
Cheese =
Baked Potato =
Pasta Bake =
Raw Pasta Bake =
chicken Soup =
tomato Soup =
Uncooked tomato Soup =
Uncooked chicken Soup =
apple Juice =
cactus Juice =
Rainbow Juice =
Orange Juice =
Cake =
Chocolate Cake =
Carrot Cake =
Cheese cake =
Cake Mix =
Chocolate Cake Mix =
Carrot Cake Mix =
Cheese Cake Mix =

View File

@ -14,6 +14,9 @@
-- Add support for other mods
food.support("cocoa", "farming_plus:cocoa_bean")
food.support("cup", "vessels:drinking_glass")
food.support("cactus", "default:cactus")
food.support("apple", "default:apple")
food.support("orange", "farming_plus:orange_item")
food.support("potato", {
"docfarming:potato",
"veggies:potato",
@ -69,3 +72,10 @@ else
food.support("flour", "farming:flour")
end
if minetest.get_modpath("mtfoods") then
food.support("strawberry", "farming_plus:strawberry_item")
food.support("strawberry", "plantlib:strawberry")
food.support("strawberry", "bushes:strawberry")
food.support("rhubarb", "farming_plus:rhubarb_item")
end

View File

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

View File

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 321 B

View File

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 437 B

View File

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 474 B

View File

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 343 B

View File

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 338 B

View File

Before

Width:  |  Height:  |  Size: 476 B

After

Width:  |  Height:  |  Size: 476 B

View File

Before

Width:  |  Height:  |  Size: 867 B

After

Width:  |  Height:  |  Size: 867 B

View File

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 786 B

View File

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

View File

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 712 B

View File

Before

Width:  |  Height:  |  Size: 709 B

After

Width:  |  Height:  |  Size: 709 B

View File

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 758 B

View File

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 758 B

View File

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 327 B

View File

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 575 B

View File

Before

Width:  |  Height:  |  Size: 487 B

After

Width:  |  Height:  |  Size: 487 B

View File

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 510 B

View File

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

View File

Before

Width:  |  Height:  |  Size: 480 B

After

Width:  |  Height:  |  Size: 480 B

View File

Before

Width:  |  Height:  |  Size: 672 B

After

Width:  |  Height:  |  Size: 672 B

View File

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 378 B

View File

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 624 B

View File

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 426 B

View File

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 559 B

View File

Before

Width:  |  Height:  |  Size: 479 B

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

View File

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 310 B

View File

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 366 B

View File

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

View File

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 252 B

View File

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 396 B

View File

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 355 B

View File

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 325 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 321 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 338 B

View File

Before

Width:  |  Height:  |  Size: 566 B

After

Width:  |  Height:  |  Size: 566 B

View File

@ -1,250 +0,0 @@
-- FOOD MOD
-- A mod written by rubenwardy that adds
-- food to the minetest game
-- =====================================
-- >> food/ingredients.lua
-- Fallback ingredients
-- =====================================
food.module("wheat", function()
minetest.register_craftitem("food:wheat", {
description = S("Wheat"),
inventory_image = "food_wheat.png",
groups = {food_wheat=1}
})
food.craft({
output = "farming:wheat",
recipe = {
{"farming:wheat"}
},
})
end, true)
food.module("flour", function()
minetest.register_craftitem("food:flour", {
description = S("Flour"),
inventory_image = "food_flour.png",
groups = {food_flour = 1}
})
food.craft({
output = "food:flour",
recipe = {
{"group:food_wheat"},
{"group:food_wheat"}
}
})
end, true)
food.module("potato", function()
minetest.register_craftitem("food:potato", {
description = S("Potato"),
inventory_image = "food_potato.png",
groups = {food_potato = 1}
})
food.craft({
output = "food:potato",
recipe = {
{"farming:potato"}
},
})
end, true)
food.module("tomato", function()
minetest.register_craftitem("food:tomato", {
description = S("Tomato"),
inventory_image = "food_tomato.png",
groups = {food_tomato = 1}
})
food.craft({
output = "food:tomato",
recipe = {
{"farming:tomato"}
},
})
end, true)
food.module("carrot", function()
minetest.register_craftitem("food:carrot", {
description = S("Carrot"),
inventory_image = "food_carrot.png",
groups = {food_carrot=1},
on_use = food.item_eat(3)
})
food.craft({
output = "food:carrot",
recipe = {
{"farming:carrot"}
},
})
end, true)
food.module("milk", function()
minetest.register_craftitem("food:milk", {
description = S("Milk"),
image = "food_milk.png",
on_use = food.item_eat(1),
groups = { eatable=1, food_milk = 1 },
stack_max=10
})
food.craft({
output = "food:milk",
recipe = {
{"mobs:bucket_milk"}
},
})
end, true)
food.module("egg", function()
minetest.register_craftitem("food:egg", {
description = S("Egg"),
inventory_image = "food_egg.png",
groups = {food_egg=1}
})
food.craft({
output = "food:egg",
recipe = {
{"mobs:egg"}
}
})
end, true)
food.module("cocoa", function()
minetest.register_craftitem("food:cocoa", {
description = S("Cocoa Bean"),
inventory_image = "food_cocoa.png",
groups = {food_cocoa=1}
})
food.craft({
output = "food:cocoa",
recipe = {
{"farming:cocoa_beans"}
}
})
end, true)
food.module("meat", function()
minetest.register_craftitem("food:meat", {
description = S("Venison"),
inventory_image = "food_meat.png",
groups = {food_meat=1, food_chicken=1}
})
food.craft({
type = "cooking",
output = "food:meat",
recipe = "group:food_meat_raw",
cooktime = 30
})
if not minetest.get_modpath("animalmaterials") then
minetest.register_craftitem("food:meat_raw", {
description = S("Raw meat"),
image = "food_meat_raw.png",
on_use = food.item_eat(1),
groups = { meat=1, eatable=1, food_meat_raw=1 },
stack_max=25
})
food.craft({
output = "food:meat_raw",
recipe = {
{"mobs:meat_raw"}
}
})
end
end, true)
food.module("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, true)
food.module("chocolate_powder", function()
minetest.register_craftitem("food:chocolate_powder", {
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()
minetest.register_craftitem("food:pasta",{
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()
minetest.register_craftitem("food:bowl",{
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()
minetest.register_craftitem("food:butter", {
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()
minetest.register_craftitem("food:cheese", {
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({
type = "cooking",
output = "food:meat",
recipe = "animalmaterials:meat_raw",
cooktime = 30
})
end

View File

@ -1,38 +0,0 @@
# template
Wheat =
Flour =
Potato =
Tomato =
Carrot =
Milk =
Egg =
Cocoa Bean =
Raw meat =
Venison =
Sugar =
Chocolate Powder =
Dark Chocolate =
Milk Chocolate =
Pasta =
Bowl =
Butter =
Cheese =
Baked Potato =
Pasta Bake =
Raw Pasta Bake =
chicken Soup =
tomato Soup =
Uncooked tomato Soup =
Uncooked chicken Soup =
apple Juice =
cactus Juice =
Rainbow Juice =
Cake =
Chocolate Cake =
Carrot Cake =
Cheese cake =
Cake Mix =
Chocolate Cake Mix =
Carrot Cake Mix =
Cheese Cake Mix =

0
mods/food/modpack.txt Normal file
View File

View File

@ -350,6 +350,22 @@ if minetest.get_modpath("ferns") ~= nil then
overwrite("ferns:horsetail_01", 1)
end
-- Food mod by Rubenwardy ( https://github.com/rubenwardy/food )
if minetest.get_modpath("food") ~= nil then
overwrite("food:apple_juice", 1)
overwrite("food:rainbow_juice", 6)
overwrite("food:cheese", 4)
overwrite("food:cactus_juice", 3)
overwrite("food:cake", 5)
overwrite("food:cake_carrot", 6)
overwrite("food:cake_choco", 7)
overwrite("food:milk", 3)
overwrite("food:milk_chocolate", 4)
overwrite("food:pasta_bake", 7)
overwrite("food:soup_chicken", 4)
overwrite("food:soup_tomato", 4)
end
-- player-action based hunger changes
function hud.handle_node_actions(pos, oldnode, player, ext)
if not player or not player:is_player() then