diff --git a/README.md b/README.md index f8cf2e8..2f546fc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Moon phases -Make your sky change follow a cycle +Make your moon follow a realistic cycle __Important__: This mod requires at least Minetest 5.2.0 for the game's new sky API. Make sure you have the latest version installed or [update your game](https://www.minetest.net/downloads/). @@ -33,6 +33,6 @@ All source code is licensed under GNU LESSER GENERAL PUBLIC LICENSE version 3. You can find a copy of that license in the repository. ## Media -All included moon textures are resized versions of graphics from *NASA's Scientific Visualization Studio*. -These images are part of the Public Domain. +All included moon textures are resized versions of graphics from *NASA's Scientific Visualization Studio* by [Ernie Wright](https://svs.gsfc.nasa.gov/cgi-bin/search.cgi?person=1059). +These images are part of the Public Domain as CC-BY-SA 3.0. You can access the entire (high resolution) album on [their website](https://svs.gsfc.nasa.gov/4769#28564). See [NASA's media guidelines](https://www.nasa.gov/multimedia/guidelines/index.html) for more information on licensing. diff --git a/depends.txt b/depends.txt index 5280a97..658ff4e 100644 --- a/depends.txt +++ b/depends.txt @@ -1 +1,2 @@ -skylayer? \ No newline at end of file +skylayer? +datastorage? \ No newline at end of file diff --git a/init.lua b/init.lua index 5a57b5b..897e2b2 100644 --- a/init.lua +++ b/init.lua @@ -18,9 +18,6 @@ local function get_cycle_config() end local PHASE_LENGTH = get_cycle_config() -if state.day >= PHASE_LENGTH then - state.day = 1 -end local function set_texture(player, texture) local sl = {} @@ -46,8 +43,7 @@ local function handle_time_progression() local time = minetest.get_timeofday() if time >= 0.5 and state.change_time then state.day = state.day + 1 - if state.day == PHASE_LENGTH then - state.day = 1 + if state.day % PHASE_LENGTH == 0 then state.phase = (state.phase % 8) + 1 state.change_time = false update_textures()