forked from mtcontrib/diet
Add awards support (#68)
This commit is contained in:
parent
1dfd4a0c66
commit
28ff84ca00
@ -1,3 +1,4 @@
|
||||
awards?
|
||||
hbhunger?
|
||||
hud?
|
||||
hunger?
|
||||
|
9
init.lua
9
init.lua
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user