mcl_tomato: refactor: use new food registration utility.

This commit is contained in:
trans_soup 2023-07-17 13:11:14 +02:00
parent 396d54dd0d
commit 5d9abe9cfe

View file

@ -8,40 +8,22 @@ mcl_vegan.register_plant_items(modname, "tomato", {
food_strength = 2.0,
})
minetest.register_craftitem(modname .. ":pasta", {
local reg_food = mcl_vegan.register_food
reg_food(modname, "pasta", {
description = "Noddles :3",
inventory_image = modname .. "_pasta.png",
groups = {
craftitem = 1,
food = 1,
eatable = 3,
},
_mcl_saturation = 3.0,
on_place = minetest.item_eat(3),
on_secondary_use = minetest.item_eat(3),
food_strength = 3.0,
saturation = 2.0,
})
minetest.register_craftitem(modname .. ":sauce", {
reg_food(modname, "sauce", {
description = "Tomato Sauce",
inventory_image = modname .. "_sauce.png",
groups = {
craftitem = 1,
food = 1,
eatable = 2,
},
_mcl_saturation = 2.0,
on_place = minetest.item_eat(2),
on_secondary_use = minetest.item_eat(2),
food_strength = 2.0,
saturation = 2.0,
})
minetest.register_craftitem(modname .. ":pasta_with_sauce", {
reg_food(modname, "pasta_with_sauce", {
description = "Noddles with Tomato Sauce",
inventory_image = modname .. "_pasta_with_sauce.png",
groups = {
food = 2,
eatable = 8,
},
_mcl_saturation = 8.0,
on_place = minetest.item_eat(8),
on_secondary_use = minetest.item_eat(8),
food_strength = 8.0,
saturation = 8.0,
})