summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-29 12:58:55 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-29 12:59:59 -0500
commit5e2753c712e8f65fa50f4889fc1422393ba21413 (patch)
tree04aab9306f77497e712ad13ae3445d878280881d /doc/lua_api.txt
parentff3cfb746e203ed02160de09b1912b543c5a25f0 (diff)
downloadminetest-5e2753c712e8f65fa50f4889fc1422393ba21413.tar.gz
minetest-5e2753c712e8f65fa50f4889fc1422393ba21413.tar.bz2
minetest-5e2753c712e8f65fa50f4889fc1422393ba21413.zip
Expose mapgen parameters on scripting init
Add minetest.get_mapgen_params() Deprecate minetest.register_on_mapgen_init()
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index f48c433c6..7dae2c58a 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1504,8 +1504,9 @@ minetest.register_on_player_receive_fields(func(player, formname, fields))
^ Newest functions are called first
^ If function returns true, remaining functions are not called
minetest.register_on_mapgen_init(func(MapgenParams))
-^ Called just before the map generator is initialized but before the environment is initialized
-^ MapgenParams consists of a table with the fields mgname, seed, water_level, and flags
+^ Deprecated; maintained for compatibility
+^ This immediately calls func(minetest.get_mapgen_params())
+^ MapgenParams consists of a table with the fields mgname, chunksize, seed, water_level, and flags
minetest.register_on_craft(func(itemstack, player, old_craft_grid, craft_inv))
^ Called when player crafts something
^ itemstack is the output
@@ -1621,6 +1622,10 @@ minetest.set_gen_notify(flags, {deco_ids})
^ The second parameter is a list of IDS of decorations which notification is requested for
minetest.get_mapgen_object(objectname)
^ Return requested mapgen object if available (see Mapgen objects)
+minetest.get_mapgen_params()
+^ Returns mapgen params
+^ A table consisting of mgname, seed, chunksize, water_level, and flags
+^ Can be called at any time
minetest.set_mapgen_params(MapgenParams)
^ Set map generation parameters
^ Function cannot be called after the registration period; only initialization and on_mapgen_init