add {eatable} group to food items and update infotext

This commit is contained in:
tenplus1 2024-07-26 14:31:27 +01:00
parent 937e1c6cb5
commit 71431a298d
2 changed files with 5 additions and 28 deletions

View File

@ -14,7 +14,7 @@ local S = wine.S
-- blue agave
minetest.register_node("wine:blue_agave", {
description = S("Blue Agave"),
description = S("Blue Agave") .. " (♥2)",
drawtype = "plantlike",
visual_scale = 0.8,
tiles = {"wine_blue_agave.png"},
@ -28,7 +28,7 @@ minetest.register_node("wine:blue_agave", {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0.3, 0.2}
},
groups = {snappy = 3, attached_node = 1, plant = 1},
groups = {snappy = 3, attached_node = 1, plant = 1, eatable = 2},
sounds = snd_l,
on_use = minetest.item_eat(2),

View File

@ -19,36 +19,14 @@ if mcl then
glass_item = "mcl_core:glass"
end
-- check for Unified Inventory
local is_uninv = minetest.global_exists("unified_inventory") or false
-- is thirsty mod active
local thirsty_mod = minetest.get_modpath("thirsty")
-- translation support
local S
if minetest.get_translator then
S = minetest.get_translator("wine")
else
S = function(s, a, ...)
if a == nil then
return s
end
a = {a, ...}
return s:gsub("(@?)@(%(?)(%d+)(%)?)", function(e, o, n, c)
if e == ""then
return a[tonumber(n)] .. (o == "" and c or "")
else
return "@" .. o .. n .. c
end
end)
end
end
wine.S = S
local S = minetest.get_translator("wine") ; wine.S = S
-- Unified Inventory hints
if is_uninv then
@ -61,7 +39,6 @@ if is_uninv then
})
end
-- fermentation list (drinks added in drinks.lua)
local ferment = {}
@ -98,7 +75,7 @@ function wine:add_drink(name, desc, has_bottle, num_hunger, num_thirst, alcoholi
-- glass
minetest.register_node("wine:glass_" .. name, {
description = S("Glass of " .. desc),
description = S("Glass of " .. desc) .. " (♥" .. num_hunger .. ")",
drawtype = "plantlike",
visual_scale = 0.5,
tiles = {"wine_" .. name .. "_glass.png"},
@ -113,7 +90,7 @@ function wine:add_drink(name, desc, has_bottle, num_hunger, num_thirst, alcoholi
fixed = {-0.15, -0.5, -0.15, 0.15, 0, 0.15}
},
groups = {
vessel = 1, dig_immediate = 3,
vessel = 1, dig_immediate = 3, eatable = num_hunger,
attached_node = 1, drink = 1, alcohol = alcoholic
},
sounds = snd_g,