climate_api/lib/datastorage.lua

16 lines
278 B
Lua
Raw Normal View History

local default_state = {
heat = 1,
humidity = 1,
2020-04-13 01:55:39 +02:00
wind_x = 0.5,
wind_z = 0.5,
time_last_check = 0,
time_current_day = 1
}
2020-04-13 01:55:39 +02:00
local state = minetest.get_mod_storage()
2020-04-13 01:55:39 +02:00
if not state:contains("time_last_check") then
state:from_table({ fields = default_state })
end
2020-04-13 01:55:39 +02:00
return state