From 8115f61ac9d3203c8d55544ae972149070b2e6df Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 26 Jul 2024 14:42:34 +0100 Subject: [PATCH] add {eatable} group to food items and update infotext --- crafts.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/crafts.lua b/crafts.lua index 29a9eef..161cf92 100644 --- a/crafts.lua +++ b/crafts.lua @@ -45,18 +45,18 @@ minetest.register_craftitem("mobs:leather", { -- raw meat minetest.register_craftitem("mobs:meat_raw", { - description = S("Raw Meat"), + description = S("Raw Meat") .. " (♥3)", inventory_image = "mobs_meat_raw.png", on_use = minetest.item_eat(3), - groups = {food_meat_raw = 1, flammable = 2} + groups = {food_meat_raw = 1, flammable = 2, eatable = 3} }) -- cooked meat minetest.register_craftitem("mobs:meat", { - description = S("Meat"), + description = S("Meat") .. " (♥8)", inventory_image = "mobs_meat.png", on_use = minetest.item_eat(8), - groups = {food_meat = 1, flammable = 2} + groups = {food_meat = 1, flammable = 2, eatable = 8} }) minetest.register_craft({ @@ -375,10 +375,13 @@ end) -- Meat Block minetest.register_node("mobs:meatblock", { - description = S("Meat Block"), + description = S("Meat Block") .. " (♥20)", tiles = {"mobs_meat_top.png", "mobs_meat_bottom.png", "mobs_meat_side.png"}, paramtype2 = "facedir", - groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, axey = 1, handy = 1}, + groups = { + choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, axey = 1, handy = 1, + eatable = 20 + }, is_ground_content = false, sounds = mod_def and default.node_sound_leaves_defaults(), on_place = minetest.rotate_node, @@ -398,10 +401,13 @@ minetest.register_craft({ -- Meat Block (raw) minetest.register_node("mobs:meatblock_raw", { - description = S("Raw Meat Block"), + description = S("Raw Meat Block") .. " (♥20)", tiles = {"mobs_meat_raw_top.png", "mobs_meat_raw_bottom.png", "mobs_meat_raw_side.png"}, paramtype2 = "facedir", - groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, axey = 1, handy = 1}, + groups = { + choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, axey = 1, handy = 1, + eatable = 20 + }, is_ground_content = false, sounds = mod_def and default.node_sound_leaves_defaults(), on_place = minetest.rotate_node,