1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-06-29 23:01:00 +02:00

add helper function to add {eatable}

This commit is contained in:
tenplus1
2024-07-26 16:30:53 +01:00
parent 648bae7517
commit 75e3f9fb42
41 changed files with 387 additions and 205 deletions

View File

@ -8,23 +8,27 @@ local S = farming.translate
-- tomato
minetest.register_craftitem("farming:tomato", {
description = S("Tomato") .. " (♥4)",
description = S("Tomato"),
inventory_image = "farming_tomato.png",
groups = {compostability = 45, seed = 2, food_tomato = 1, flammable = 2, eatable = 4},
groups = {compostability = 45, seed = 2, food_tomato = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")
end,
on_use = minetest.item_eat(4)
})
farming.add_eatable("farming:tomato", 4)
-- tomato soup
minetest.register_craftitem("farming:tomato_soup", {
description = S("Tomato Soup") .. " (♥8)",
description = S("Tomato Soup"),
inventory_image = "farming_tomato_soup.png",
groups = {flammable = 2, compostability = 65, eatable = 8},
groups = {flammable = 2, compostability = 65},
on_use = minetest.item_eat(8, "farming:bowl")
})
farming.add_eatable("farming:tomato_soup", 8)
minetest.register_craft({
output = "farming:tomato_soup",
recipe = {