Compare commits

...

3 Commits

4 changed files with 12 additions and 37 deletions

View File

@ -1,34 +0,0 @@
hbhunger?
hud?
hunger?
default?
animalmaterials?
bucket?
bushes?
bushes_classic?
cooking?
creatures?
crops?
docfarming?
dwarves?
ethereal?
farming?
farming_plus?
ferns?
fishing?
fruit?
glooptest?
jkanimals?
jkfarming?
jkwine?
kpgmobs?
mobfcooking?
mobs?
moretrees?
mtfoods?
mush45?
flowers?
nsspf?
seaplants?
zombie?
riesenpilz?

View File

@ -1 +0,0 @@
Adds a mechanic to encourage food variety.

View File

@ -93,7 +93,7 @@ function diet.item_eat(max, replace_with_item, poisen, heal)
-- Increase health
if minetest.get_modpath("hbhunger") and hbhunger then
minetest.sound_play({name = "hbhunger_eat_generic", gain = 1}, {pos=user:getpos(), max_hear_distance = 16})
minetest.sound_play({name = "hbhunger_eat_generic", gain = 1}, {pos=user:get_pos(), max_hear_distance = 16})
-- saturation
local h = tonumber(hbhunger.hunger[name])
@ -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()

View File

@ -1,7 +1,8 @@
name = diet
title = Diet
author = rubenwardy
description = Adds a mechanic to encourage food variety.
optional_depends = awards,hbhunger,hud,hunger,default,animalmaterials,bucket,bushes,bushes_classic,cooking,creatures,crops,docfarming,dwarves,ethereal,farming,farming_plus,ferns,fishing,fruit,glooptest,jkanimals,jkfarming,jkwine,kpgmobs,mobfcooking,mobs,moretrees,mtfoods,mush45,flowers,nsspf,seaplants,zombie,riesenpilz
author = rubenwardy
license = CC0
forum = https://forum.minetest.net/viewtopic.php?t=9051
version = 0.1