forked from mtcontrib/farming
remove XP desc.
This commit is contained in:
parent
710b7ac111
commit
a74a29c849
12
init.lua
12
init.lua
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
farming = {
|
farming = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20240727",
|
version = "20240803",
|
||||||
path = minetest.get_modpath("farming"),
|
path = minetest.get_modpath("farming"),
|
||||||
select = {
|
select = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -768,8 +768,6 @@ if input then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- helper function to add {eatable} group to food items
|
-- helper function to add {eatable} group to food items
|
||||||
local mod_tt_base = minetest.get_modpath("tt_base") -- mod does similar to infotext
|
|
||||||
|
|
||||||
function farming.add_eatable(item, hp)
|
function farming.add_eatable(item, hp)
|
||||||
|
|
||||||
local def = minetest.registered_items[item]
|
local def = minetest.registered_items[item]
|
||||||
@ -777,16 +775,10 @@ function farming.add_eatable(item, hp)
|
|||||||
if def then
|
if def then
|
||||||
|
|
||||||
local groups = table.copy(def.groups) or {}
|
local groups = table.copy(def.groups) or {}
|
||||||
local txt = " (" ; if hp > 0 then txt = txt .. "+" end
|
|
||||||
txt = txt .. hp .. " HP)"
|
|
||||||
|
|
||||||
groups.eatable = hp ; groups.flammable = 2
|
groups.eatable = hp ; groups.flammable = 2
|
||||||
|
|
||||||
if mod_tt_base == nil then
|
minetest.override_item(item, {groups = groups})
|
||||||
def.description = def.description .. txt
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.override_item(item, {description = def.description, groups = groups})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user