1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2024-11-10 20:30:31 +01:00

add {eatable} group to default apple, blueberries, mushrooms if found

This commit is contained in:
tenplus1 2024-07-26 15:29:09 +01:00
parent e2ec7d707e
commit 648bae7517
2 changed files with 25 additions and 1 deletions

View File

@ -8,6 +8,30 @@ local alias = function(orig, new)
minetest.register_alias(orig, new)
end
--= Add {eatable} group to default apple, blueberries and brown mushroom
local function add_grp(item, hp)
local def = minetest.registered_items[item]
if def then
def.groups.eatable = hp
def.description = def.description .. " (♥" .. hp .. ")"
minetest.override_item(item, {
description = def.description,
groups = def.groups
})
end
end
add_grp("default:apple", 2)
add_grp("default:blueberries", 1)
add_grp("flowers:mushroom_brown", 1)
add_grp("flowers:mushroom_red", -5)
--= Aliases
-- Banana

View File

@ -1,4 +1,4 @@
name = farming
description = Adds many new plants and food into Minetest.
optional_depends = default, mcl_core, mcl_sounds, mcl_farming, mcl_stairs, mcl_flowers, stairs, lucky_block, toolranks
optional_depends = default, flowers, mcl_core, mcl_sounds, mcl_farming, mcl_stairs, mcl_flowers, stairs, lucky_block, toolranks
min_minetest_version = 5.0