1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00
luanti/src/script/lua_api
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
..
CMakeLists.txt Add Lua interface to HTTPFetchRequest 2016-02-22 15:39:41 +01:00
l_areastore.cpp Add AreaStore custom ID API 2016-03-07 16:33:20 -05:00
l_areastore.h Implement AreaStore serialization 2016-03-07 16:33:20 -05:00
l_base.cpp Use numeric indices and raw table access with LUA_REGISTRYINDEX 2015-08-27 01:56:06 +02:00
l_base.h Document for api functions that rely on current_modname, that it doesn't work when not loading mods 2015-04-08 23:05:26 +02:00
l_craft.cpp Fix minetest.get_(all)_craft_recipe(s) regression 2015-07-25 17:33:41 +02:00
l_craft.h Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
l_env.cpp Add consistent monotonic day counter - get_day_count() 2016-03-09 01:45:23 +01:00
l_env.h Add consistent monotonic day counter - get_day_count() 2016-03-09 01:45:23 +01:00
l_http.cpp Require minetest.request_http_api to be called from the mod's main scope 2016-03-03 22:42:00 +01:00
l_http.h Add Lua interface to HTTPFetchRequest 2016-02-22 15:39:41 +01:00
l_internal.h SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
l_inventory.cpp SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
l_inventory.h Use "core" namespace internally 2014-05-08 13:02:04 -04:00
l_item.cpp Make ItemStack:set_count(0) clear the item stack 2016-01-15 13:44:45 +01:00
l_item.h Use "core" namespace internally 2014-05-08 13:02:04 -04:00
l_mainmenu.cpp Remove wstrgettext 2015-10-18 02:29:06 +02:00
l_mainmenu.h l_mainmenu.h: remove unused l_get_dirlist function 2015-08-30 01:17:03 +02:00
l_mapgen.cpp Fix threshold type 2015-12-07 09:57:45 +01:00
l_mapgen.h Schematics: Add core.place_schematic_on_vmanip API 2015-11-05 01:18:32 -05:00
l_nodemeta.cpp SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
l_nodemeta.h Fixed potential NULL pointer and leak when setting node metadata 2013-11-29 23:35:16 -05:00
l_nodetimer.cpp SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
l_nodetimer.h Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
l_noise.cpp Add LuaSecureRandom 2015-11-08 15:57:15 -05:00
l_noise.h Add LuaSecureRandom 2015-11-08 15:57:15 -05:00
l_object.cpp Add option to give every object a nametag 2015-12-15 23:32:19 +01:00
l_object.h Added get_player_velocity() method. Fixes #1176 2015-07-20 05:40:44 +02:00
l_particles.cpp SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
l_particles.h Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
l_rollback.cpp SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
l_rollback.h Rollback fixes and get_node_actions 2013-11-27 18:13:06 -05:00
l_server.cpp Add server side ncurses terminal 2015-11-06 08:51:14 +01:00
l_server.h Add server side ncurses terminal 2015-11-06 08:51:14 +01:00
l_settings.cpp Add mod security 2015-05-16 18:32:31 -04:00
l_settings.h Add Settings interface for Lua 2013-09-10 18:31:38 +02:00
l_util.cpp Move AreaStore to util 2016-03-07 16:33:20 -05:00
l_util.h Add server side ncurses terminal 2015-11-06 08:51:14 +01:00
l_vmanip.cpp Mapgen: Add propagate_shadow bool to calcLighting 2015-12-07 03:18:24 +00:00
l_vmanip.h Shorten ManualMapVoxelManipulator to MMVManip 2015-01-05 02:42:27 -05:00