From 396d54dd0d703630d175a7d9dd08c61248e25bf3 Mon Sep 17 00:00:00 2001 From: trans_soup <> Date: Mon, 17 Jul 2023 13:05:42 +0200 Subject: [PATCH] mcl_soy: refactor: use new food registration utility. --- mcl_soy/item.lua | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/mcl_soy/item.lua b/mcl_soy/item.lua index 34e732d..59f796d 100644 --- a/mcl_soy/item.lua +++ b/mcl_soy/item.lua @@ -8,27 +8,16 @@ mcl_vegan.register_plant_items(modname, "soy", { food_strength = 1.0, }) -minetest.register_craftitem(modname .. ":tofu_raw", { +local reg_food = mcl_vegan.register_food + +reg_food(modname, "tofu_raw", { description = "Raw Tofu", - inventory_image = modname .. "_tofu_raw.png", - groups = { - craftitem = 1, - food = 1, - eatable = 3, - }, - _mcl_saturation = 1.0, - on_place = minetest.item_eat(3), - on_secondary_use = minetest.item_eat(3), + food_strength = 3.0, + saturation = 1.0, }) -minetest.register_craftitem(modname .. ":tofu_cooked", { +reg_food(modname, "tofu_cooked", { description = "Cooked Tofu", - inventory_image = modname .. "_tofu_cooked.png", - groups = { - food = 2, - eatable = 6, - }, - _mcl_saturation = 4.0, - on_place = minetest.item_eat(6), - on_secondary_use = minetest.item_eat(6), + food_strength = 6.0, + saturation = 4.0, })