Add awards support (#68)

This commit is contained in:
bri cassa 2021-09-08 22:43:08 +02:00
parent 1dfd4a0c66
commit 28ff84ca00
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,4 @@
awards?
hbhunger?
hud?
hunger?

View File

@ -143,6 +143,15 @@ function diet.item_eat(max, replace_with_item, poisen, heal)
diet.save()
-- If awards
if minetest.get_modpath("awards") then
if user and user:is_player() and not itemstack:is_empty() then
local itemname = itemstack:get_name()
itemname = minetest.registered_aliases[itemname] or itemname
awards.notify_eat(user, itemname)
end
end
-- Remove item
itemstack:add_item(replace_with_item)
itemstack:take_item()