mirror of
https://github.com/t-affeldt/minetest_moon_phase.git
synced 2025-01-08 01:00:30 +01:00
Fix missing opt. dependency and offset cycle
This commit is contained in:
parent
05fd6a98d5
commit
e07af4cdd2
@ -1,5 +1,5 @@
|
|||||||
# Moon phases
|
# 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.
|
__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/).
|
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.
|
You can find a copy of that license in the repository.
|
||||||
|
|
||||||
## Media
|
## Media
|
||||||
All included moon textures are resized versions of graphics from *NASA's Scientific Visualization Studio*.
|
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.
|
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.
|
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.
|
||||||
|
@ -1 +1,2 @@
|
|||||||
skylayer?
|
skylayer?
|
||||||
|
datastorage?
|
6
init.lua
6
init.lua
@ -18,9 +18,6 @@ local function get_cycle_config()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local PHASE_LENGTH = get_cycle_config()
|
local PHASE_LENGTH = get_cycle_config()
|
||||||
if state.day >= PHASE_LENGTH then
|
|
||||||
state.day = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
local function set_texture(player, texture)
|
local function set_texture(player, texture)
|
||||||
local sl = {}
|
local sl = {}
|
||||||
@ -46,8 +43,7 @@ local function handle_time_progression()
|
|||||||
local time = minetest.get_timeofday()
|
local time = minetest.get_timeofday()
|
||||||
if time >= 0.5 and state.change_time then
|
if time >= 0.5 and state.change_time then
|
||||||
state.day = state.day + 1
|
state.day = state.day + 1
|
||||||
if state.day == PHASE_LENGTH then
|
if state.day % PHASE_LENGTH == 0 then
|
||||||
state.day = 1
|
|
||||||
state.phase = (state.phase % 8) + 1
|
state.phase = (state.phase % 8) + 1
|
||||||
state.change_time = false
|
state.change_time = false
|
||||||
update_textures()
|
update_textures()
|
||||||
|
Loading…
Reference in New Issue
Block a user