forked from mtcontrib/farming
add {eatable} group to default apple, blueberries, mushrooms if found
This commit is contained in:
parent
e2ec7d707e
commit
648bae7517
@ -8,6 +8,30 @@ local alias = function(orig, new)
|
|||||||
minetest.register_alias(orig, new)
|
minetest.register_alias(orig, new)
|
||||||
end
|
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
|
--= Aliases
|
||||||
|
|
||||||
-- Banana
|
-- Banana
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,4 +1,4 @@
|
|||||||
name = farming
|
name = farming
|
||||||
description = Adds many new plants and food into Minetest.
|
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
|
min_minetest_version = 5.0
|
||||||
|
Loading…
Reference in New Issue
Block a user