diff options
author | kwolekr <kwolekr@minetest.net> | 2013-06-26 17:19:39 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2013-06-27 22:35:35 -0400 |
commit | 8aa930f28e69f3518831500022988ca2a4b6985d (patch) | |
tree | 5699c9b0cd8eaa54f4fadf8dcd7d0ba98a9c3c74 /doc | |
parent | 2c0b51795e6fa6747d881f1871c89830abb6e6e8 (diff) | |
download | minetest-8aa930f28e69f3518831500022988ca2a4b6985d.tar.gz minetest-8aa930f28e69f3518831500022988ca2a4b6985d.tar.bz2 minetest-8aa930f28e69f3518831500022988ca2a4b6985d.zip |
Add minetest.get_mapgen_object to API
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 62fe94b45..84769f8d8 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1116,6 +1116,8 @@ minetest.get_perlin(seeddiff, octaves, persistence, scale) ^ Return world-specific perlin noise (int(worldseed)+seeddiff) minetest.get_voxel_manip() ^ Return voxel manipulator object +minetest.get_mapgen_object(objectname) +^ Return requested mapgen object if available (see Mapgen objects) minetest.clear_objects() ^ clear all objects in the environments minetest.line_of_sight(pos1,pos2,stepsize) ->true/false @@ -1544,6 +1546,35 @@ methods: ^ To be used only by VoxelManip objects passed to a callback; otherwise, calculated lighting will be ignored - update_liquids(): Update liquid flow +Mapgen objects +--------------- +A mapgen object is a construct used in map generation. Mapgen objects can be used by an on_generate +callback to speed up operations by avoiding unnecessary recalculations; these can be retrieved using the +minetest.get_mapgen_object() function. If the requested Mapgen object is unavailable, or +get_mapgen_object() was called outside of an on_generate() callback, nil is returned. + +The following Mapgen objects are currently available: + +- voxelmanip + This returns four values; the VoxelManip object to be used, the voxel data, minimum emerge position, +and maximum emerged position. All mapgens support this object. + +- heightmap + Returns an array containing the y coordinates of the ground levels of nodes in the most recently +generated chunk by the current mapgen. + +- biomemap + Returns an array containing the biome IDs of nodes in the most recently generated chunk by the +current mapgen. + +- heatmap + Returns an array containing the temperature values of nodes in the most recently generated chunk by +the current mapgen. + +- humiditymap + Returns an array containing the humidity values of nodes in the most recently generated chunk by the +current mapgen. + Registered entities -------------------- - Functions receive a "luaentity" as self: |