27 Commits

Author SHA1 Message Date
Loïc Blot
6483d88b89 [CSM] Add core.get_timeofday & core.get_day_count env calls (#5401)
* [CSM] Add core.get_timeofday & core.get_day_count env calls

* [CSM] Add core.get_node_level, core.get_node_max_level, core.find_node_near
2017-03-17 07:48:29 +01:00
Loic Blot
045cc40d91 [CSM] Client side modding
* rename GameScripting to ServerScripting
* Make getBuiltinLuaPath static serverside
* Add on_shutdown callback
* Add on_receiving_chat_message & on_sending_chat_message callbacks
* ScriptApiBase: use IGameDef instead of Server
  This permits to share common attribute between client & server
* Enable mod security in client side modding without conditions
2017-03-13 23:56:05 +01:00
Loic Blot
4e008ba0bb Move ServerEnvironment to dedicated cpp/header files
* also cleanup some unneeded inclusions
2017-01-08 12:16:06 +01:00
Auke Kok
9cf7a3ef96 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
est31
fd7cbba94b Add minetest.register_lbm() to run code on block load only 2016-03-07 19:54:26 +01:00
Kahrl
02cbda530b Add '/clearobjects quick' 2016-02-11 04:22:58 +00:00
kwolekr
4072700558 Add callback parameter for core.emerge_area() 2015-11-02 18:43:09 -05:00
kwolekr
be8cc00f50 SAPI: Move core.get_us_time() to Util module 2015-10-26 03:46:36 -04:00
paramat
d21809ec2e ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility
Update lua_api.txt
2015-10-18 16:42:59 +01:00
kwolekr
23316c9f92 Add /emergeblocks command and core.emerge_area() Lua API 2015-09-23 15:56:24 -04:00
kwolekr
cba840d188 Add core.find_nodes_with_meta() script API 2015-05-05 16:21:59 -04:00
Craig Robbins
102e0ee00d Change find_surface_nodes_in_area to find_nodes_in_area_under_air 2015-02-27 21:42:00 +10:00
Loic Blot
0d823b300e Add find_surface_nodes_in_area LUA call which permit to only get the nodes which touch air. This permit to massively improve performance for mods like plantlife 2015-02-27 21:34:33 +10:00
kwolekr
66b0d25786 Add ability to delete MapBlocks from map
Also add a Lua API and chatcommand for this
2015-01-15 16:48:56 -05:00
sapier
4b2e3ceaad Mod profiling support
Config settings:
profiling = true/false (gather statistics)
detailed_profiling = true/false (break mod times to callbacks)

Chat commands:
save_mod_profile saves current statistics in debug.txt and shows on console (on default loglevel)
2014-08-19 22:22:57 +02:00
ShadowNinja
9718e20bfa Use "core" namespace internally 2014-05-08 13:02:04 -04:00
proller
495ed5ec8b Remove liquid_finite and weather 2014-04-18 21:56:48 +04:00
Novatux
0a96131bf4 Add forceloading 2014-01-11 17:54:00 +01:00
Novatux
92d806ab21 Add minetest.swap_node 2013-11-30 18:37:56 +01:00
Novatux
b8ccaf35f4 Add minetest.get_gametime() API function, that returns the number of seconds since the world was created. 2013-09-08 11:09:50 +02:00
Kahrl
ee90d438b8 Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
proller
d2cbeba8b6 Better snow fall, finite liquid transform, leveled nodes api 2013-07-28 17:14:31 +04:00
proller
cdb2b82262 Weather support 2013-07-27 23:21:48 +04:00
kwolekr
5c8a16016c Add Lua on_mapgen_init callback, and minetest.set_mapgen_params API 2013-06-27 22:35:35 -04:00
kwolekr
f9c5ed3c7b Add minetest.get_mapgen_object to API 2013-06-27 22:35:35 -04:00
kwolekr
669194d224 Add LuaVoxelManip 2013-06-27 22:35:35 -04:00
sapier
2dceda8890 Move scriptapi to separate folder (by sapier)
On the lua side, notably minetest.env:<function>(<args>) should now
be replaced by minetest.<function>(<args>).
The old way is and will stay supported for a long time.

Also:
Update and clean up lua_api.txt (by celeron55)
Move EnvRef to lua and remove add_rat and add_firefly (by kahrl)
Add separate src/util/CMakeLists.txt, other minor fixes (by kahrl)
2013-05-25 00:51:02 +02:00