+ mod_storage:set_int(name.."hunger", temp_pool.hunger )
+ mod_storage:set_int(name.."satiation", temp_pool.satiation )
+ mod_storage:set_int(name.."exhaustion", temp_pool.exhaustion )
+ mod_storage:set_int(name.."regeneration_interval",temp_pool.regeneration_interval)
+
+ mod_storage:set_int(name.."h_save",1)
+
+ pool[name] = nil
+end
+
+
+-- is used for shutdowns to save all data
+local save_all = function()
+ for name,_ in pairs(pool) do
+ save_data(name)
+ end
+end
+
+-- an easy translation pool
+local satiation_pool = {
+ [0] = 1,
+ [0.5] = 3,
+ [1] = 6,
+ [2] = 8,
+ [3] = 1
+}
+-- ticks up the exhaustion when counting down satiation
+local tick_up_satiation = function(state,exhaustion)
+ return(exhaustion + satiation_pool[state])
+end
+
+-- an easy translation pool
+local hunger_pool = {
+ [0] = 1,
+ [0.5] = 2,
+ [1] = 3,
+ [2] = 4,
+ [3] = 1
+}
+-- ticks up the exhaustion when counting down hunger
+local tick_up_hunger = function(state,exhaustion)
+ return(exhaustion + hunger_pool[state])
+end
+
+-- allows other mods to set hunger data
+local name
+get_player_hunger = function(player)
+ name = player:get_player_name()
+ return(pool[name].hunger)
+end
+
+
+-- saves specific users data for when they relog
+minetest.register_on_leaveplayer(function(player)
+ save_data(player)