mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-12-01 02:33:00 +00:00
Fix mcl_hunger init
This commit is contained in:
parent
3de12ec1d1
commit
c4c3afa375
1 changed files with 6 additions and 3 deletions
|
@ -88,15 +88,18 @@ end
|
||||||
|
|
||||||
-- API START --
|
-- API START --
|
||||||
mcl_hunger.get_hunger = function(player)
|
mcl_hunger.get_hunger = function(player)
|
||||||
return tonumber(player:get_attribute("mcl_hunger:hunger")) or 20
|
local hunger = player:get_attribute("mcl_hunger:hunger") or 20
|
||||||
|
return tonumber(hunger)
|
||||||
end
|
end
|
||||||
|
|
||||||
mcl_hunger.get_saturation = function(player)
|
mcl_hunger.get_saturation = function(player)
|
||||||
return tonumber(player:get_attribute("mcl_hunger:saturation")) or mcl_hunger.SATURATION_INIT
|
local saturation = player:get_attribute("mcl_hunger:saturation") or mcl_hunger.SATURATION_INIT
|
||||||
|
return tonumber(saturation)
|
||||||
end
|
end
|
||||||
|
|
||||||
mcl_hunger.get_exhaustion = function(player)
|
mcl_hunger.get_exhaustion = function(player)
|
||||||
return tonumber(player:get_attribute("mcl_hunger:exhaustion")) or 0
|
local exhaustion = player:get_attribute("mcl_hunger:exhaustion") or 0
|
||||||
|
return tonumber(exhaustion)
|
||||||
end
|
end
|
||||||
|
|
||||||
mcl_hunger.set_hunger = function(player, hunger, update_hudbars)
|
mcl_hunger.set_hunger = function(player, hunger, update_hudbars)
|
||||||
|
|
Loading…
Reference in a new issue