1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-08-13 16:53:49 -04:00
minetest/builtin
Auke Kok 4e59fcf5c1 Add consistent monotonic day counter - get_day_count()
I've written several experimental bits of code that revolve around the
need for a consistent calendar, but implementing one is extremely hard
in mods due to time changes and mods overriding core.get_timeofday(),
which will conflict.

The second part of the problem is that doing this from a mod requires
constant maintenance of a settings file.

An implementation in core is trivial, however, and solves all of
these problems at virtually no cost: No extra branches in server
steps, and a single branch when minetest.set_time_of_day(), which is
entirely reasonable.

We store the day_count value in env_meta.txt.

The use case is obvious: This change allows mods to create an actual
virtual calendar, or properly account for seasonal changes, etc..

We add a "/days" chatcommand that displays the current day count. No
permissions are needed. It can only retrieve the day count, not
modify it.
2016-03-09 01:45:23 +01:00
..
async Use "core" namespace internally 2014-05-08 13:02:04 -04:00
common Faster insertion into table 2016-03-06 23:42:04 +00:00
fstk Faster insertion into table 2016-03-06 23:42:04 +00:00
game Add consistent monotonic day counter - get_day_count() 2016-03-09 01:45:23 +01:00
mainmenu Settings Tab: Regroup dropdown datas in tables 2016-03-06 23:42:21 +00:00
init.lua builtin: Fix print crashing on nil "holes". 2016-02-08 01:55:02 +01:00
settingtypes.txt Add forgotten valleys mapgen in mapgen name 2016-03-05 16:06:27 +01:00