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:
@ -9,10 +9,10 @@ local a = farming.recipe_items
|
||||
|
||||
-- carrot
|
||||
minetest.register_craftitem("farming:carrot", {
|
||||
description = S("Carrot") .. " (♥4)",
|
||||
description = S("Carrot"),
|
||||
inventory_image = "farming_carrot.png",
|
||||
groups = {
|
||||
compostability = 48, seed = 2, food_carrot = 1, flammable = 2, eatable = 4
|
||||
compostability = 48, seed = 2, food_carrot = 1, flammable = 2
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
|
||||
@ -20,14 +20,18 @@ minetest.register_craftitem("farming:carrot", {
|
||||
on_use = minetest.item_eat(4)
|
||||
})
|
||||
|
||||
farming.add_eatable("farming:carrot", 4)
|
||||
|
||||
-- carrot juice
|
||||
minetest.register_craftitem("farming:carrot_juice", {
|
||||
description = S("Carrot Juice") .. " (♥4)",
|
||||
description = S("Carrot Juice"),
|
||||
inventory_image = "farming_carrot_juice.png",
|
||||
on_use = minetest.item_eat(4, "vessels:drinking_glass"),
|
||||
groups = {vessel = 1, drink = 1, eatable = 4}
|
||||
groups = {vessel = 1, drink = 1}
|
||||
})
|
||||
|
||||
farming.add_eatable("farming:carrot_juice", 4)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:carrot_juice",
|
||||
recipe = {
|
||||
@ -42,12 +46,14 @@ minetest.register_craft({
|
||||
|
||||
-- golden carrot
|
||||
minetest.register_craftitem("farming:carrot_gold", {
|
||||
description = S("Golden Carrot") .. " (♥10)",
|
||||
description = S("Golden Carrot"),
|
||||
inventory_image = "farming_carrot_gold.png",
|
||||
on_use = minetest.item_eat(10),
|
||||
groups = {eatable = 10}
|
||||
groups = {flammable = 2}
|
||||
})
|
||||
|
||||
farming.add_eatable("farming:carrot_gold", 10)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:carrot_gold",
|
||||
recipe = {{"group:food_carrot", "default:gold_lump"}}
|
||||
|
Reference in New Issue
Block a user