aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-06-27 17:06:52 -0400
committerkwolekr <kwolekr@minetest.net>2013-06-27 22:35:35 -0400
commit2e292b67a0a02b045969034c06aaf92b42a83a81 (patch)
tree499310d109cbd737633eb99a245e0054a0c458d7 /doc
parent18882a4d2603488bdfb5a519a8bedf300b154940 (diff)
downloadminetest-2e292b67a0a02b045969034c06aaf92b42a83a81.tar.gz
minetest-2e292b67a0a02b045969034c06aaf92b42a83a81.tar.bz2
minetest-2e292b67a0a02b045969034c06aaf92b42a83a81.zip
Add Lua on_mapgen_init callback, and minetest.set_mapgen_params API
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 62abb2e3e..a4e1372da 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1034,6 +1034,9 @@ minetest.register_on_player_receive_fields(func(player, formname, fields))
^ Called when a button is pressed in player's inventory form
^ 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
Other registration functions:
minetest.register_chatcommand(cmd, chatcommand definition)
@@ -1118,6 +1121,14 @@ minetest.get_voxel_manip()
^ Return voxel manipulator object
minetest.get_mapgen_object(objectname)
^ Return requested mapgen object if available (see Mapgen objects)
+minetest.set_mapgen_params(MapgenParams)
+^ Set map generation parameters
+^ Function can *only* be called within a minetest.on_mapgen_init() callback
+^ Takes a table as an argument with the fields mgname, seed, water_level, flags, and flagmask.
+^ Leave field unset to leave that parameter unchanged
+^ flagmask field must be set to all mapgen flags that are being modified
+^ flags contains only the flags that are being set
+^ flags and flagmask are in the same format and have the same options as 'mgflags' in minetest.conf
minetest.clear_objects()
^ clear all objects in the environments
minetest.line_of_sight(pos1,pos2,stepsize) ->true/false