From 8aa930f28e69f3518831500022988ca2a4b6985d Mon Sep 17 00:00:00 2001 From: kwolekr Date: Wed, 26 Jun 2013 17:19:39 -0400 Subject: Add minetest.get_mapgen_object to API --- doc/lua_api.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'doc') 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: -- cgit v1.2.3