Update food item usage help
This commit is contained in:
parent
90a28d3ec5
commit
1188a499d6
|
@ -65,16 +65,31 @@ end)
|
|||
|
||||
-- Comestibles
|
||||
doc.sub.items.register_factoid(nil, "use", function(itemstring, def)
|
||||
local s = ""
|
||||
if def.groups.eatable and not def._doc_items_usagehelp then
|
||||
if def.groups.food == 2 then
|
||||
return "To eat it, wield it, then rightclick."
|
||||
s = s .. "To eat it, wield it, then rightclick."
|
||||
if def.groups.can_eat_when_full == 1 then
|
||||
s = s .. "\n" .. "You can eat this even when your hunger bar is full."
|
||||
else
|
||||
s = s .. "\n" .. "You cannot eat this when your hunger bar is full."
|
||||
end
|
||||
elseif def.groups.food == 3 then
|
||||
return "To drink it, wield it, then rightclick."
|
||||
s = s .. "To drink it, wield it, then rightclick."
|
||||
if def.groups.can_eat_when_full ~= 1 then
|
||||
s = s .. "\n" .. "You cannot drink this when your hunger bar is full."
|
||||
end
|
||||
else
|
||||
return "To consume it, wield it, then rightclick."
|
||||
s = s .. "To consume it, wield it, then rightclick."
|
||||
if def.groups.can_eat_when_full ~= 1 then
|
||||
s = s .. "\n" .. "You cannot consume this when your hunger bar is full."
|
||||
end
|
||||
end
|
||||
if def.groups.no_eat_delay ~= 1 then
|
||||
s = s .. "\n" .. "You have to wait for about 2 seconds before you can eat or drink again."
|
||||
end
|
||||
end
|
||||
return ""
|
||||
return s
|
||||
end)
|
||||
|
||||
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
|
||||
|
|
|
@ -30,7 +30,7 @@ minetest.register_craft({
|
|||
minetest.register_node("mcl_cake:cake", {
|
||||
description = "Cake",
|
||||
_doc_items_longdesc = "Cakes can be placed and eaten to restore hunger points. A cake has 7 slices. Each slice restores 2 hunger points and 0.4 saturation points. Cakes will be destroyed when dug or when the block below them is broken.",
|
||||
_doc_items_usagehelp = "Place the cake anywhere, then rightclick it to eat a single slice.",
|
||||
_doc_items_usagehelp = "Place the cake anywhere, then rightclick it to eat a single slice. You can't eat from the cake when your hunger bar is full.",
|
||||
tiles = {"cake_top.png","cake_bottom.png","cake_side.png","cake_side.png","cake_side.png","cake_side.png"},
|
||||
inventory_image = "cake.png",
|
||||
wield_image = "cake.png",
|
||||
|
|
Loading…
Reference in New Issue