forked from mtcontrib/diet
Compare commits
3 Commits
nalc-1.2.0
...
master
Author | SHA1 | Date | |
---|---|---|---|
bdb3fd875a | |||
28ff84ca00 | |||
1dfd4a0c66 |
34
depends.txt
34
depends.txt
|
@ -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?
|
|
@ -1 +0,0 @@
|
|||
Adds a mechanic to encourage food variety.
|
11
init.lua
11
init.lua
|
@ -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()
|
||||
|
|
3
mod.conf
3
mod.conf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user