Update food item usage help

This commit is contained in:
Wuzzy 2017-05-23 02:55:48 +02:00
parent 90a28d3ec5
commit 1188a499d6
2 changed files with 20 additions and 5 deletions

View File

@ -65,16 +65,31 @@ end)
-- Comestibles -- Comestibles
doc.sub.items.register_factoid(nil, "use", function(itemstring, def) 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.eatable and not def._doc_items_usagehelp then
if def.groups.food == 2 then if def.groups.food == 2 then
return "To eat it, wield it, then rightclick." s = s .. "To eat it, wield it, then rightclick."
elseif def.groups.food == 3 then if def.groups.can_eat_when_full == 1 then
return "To drink it, wield it, then rightclick." s = s .. "\n" .. "You can eat this even when your hunger bar is full."
else else
return "To consume it, wield it, then rightclick." s = s .. "\n" .. "You cannot eat this when your hunger bar is full."
end
elseif def.groups.food == 3 then
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
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
end end
return "" 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 s
end) end)
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def) doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)

View File

@ -30,7 +30,7 @@ minetest.register_craft({
minetest.register_node("mcl_cake:cake", { minetest.register_node("mcl_cake:cake", {
description = "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_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"}, tiles = {"cake_top.png","cake_bottom.png","cake_side.png","cake_side.png","cake_side.png","cake_side.png"},
inventory_image = "cake.png", inventory_image = "cake.png",
wield_image = "cake.png", wield_image = "cake.png",