summaryrefslogtreecommitdiff
path: root/hunger.lua
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2013-06-28 23:03:54 +0200
committerBlockMen <nmuelll@web.de>2013-06-28 23:03:54 +0200
commita22a08f06d7ee3221883649ad420548c3d85a162 (patch)
tree64e851661ca8d25f48c2c9b572bdefc7fc190ad8 /hunger.lua
parentd3e8f7134aacacca5c5980ff108f576f7b1f4bd0 (diff)
Update to 0.2
Diffstat (limited to 'hunger.lua')
-rw-r--r--hunger.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/hunger.lua b/hunger.lua
index 9e0f7ff..36f2ddd 100644
--- a/hunger.lua
+++ b/hunger.lua
@@ -1,10 +1,12 @@
function hud.item_eat(hunger_change, replace_with_item)
+ minetest.chat_send_all("eat")
return function(itemstack, user, pointed_thing)
if itemstack:take_item() ~= nil then
local h = tonumber(hud.hunger[user:get_player_name()])
h=h+hunger_change
- if h>20 then h=20 end
+ if h>30 then h=30 end
hud.hunger[user:get_player_name()]=h
+ hud.save_hunger(user)
itemstack:add_item(replace_with_item) -- note: replace_with_item is optional
--sound:eat
end
@@ -30,5 +32,5 @@ end
overwrite("default:apple", 2, true)
if minetest.get_modpath("farming") ~= nil then
- overwrite("farming:bread", 6, false)
+ overwrite("farming:bread", 4, false)
end