aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-06-25 11:02:02 -0400
committerkwolekr <kwolekr@minetest.net>2013-06-27 22:35:35 -0400
commitd6ac3d8d9a6484f2d348d1caea203de0069b6bd6 (patch)
treeaacdcb34b068a45a7f798769519632657813a554 /doc/lua_api.txt
parente47f6fdfe985b8907e0aa7372bb325ceb5ed5f4c (diff)
downloadminetest-d6ac3d8d9a6484f2d348d1caea203de0069b6bd6.tar.gz
minetest-d6ac3d8d9a6484f2d348d1caea203de0069b6bd6.tar.bz2
minetest-d6ac3d8d9a6484f2d348d1caea203de0069b6bd6.zip
Add LuaVoxelManip
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt24
1 files changed, 23 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 8231364fb..62fe94b45 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1052,7 +1052,6 @@ minetest.setting_get(name) -> string or nil
minetest.setting_getbool(name) -> boolean value or nil
minetest.setting_get_pos(name) -> position or nil
minetest.setting_save() -> nil, save all settings to config file
-minetest.add_to_creative_inventory(itemstring)
Authentication:
minetest.notify_authentication_modified(name)
@@ -1115,6 +1114,8 @@ minetest.find_nodes_in_area(minp, maxp, nodenames) -> list of positions
^ nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
minetest.get_perlin(seeddiff, octaves, persistence, scale)
^ Return world-specific perlin noise (int(worldseed)+seeddiff)
+minetest.get_voxel_manip()
+^ Return voxel manipulator object
minetest.clear_objects()
^ clear all objects in the environments
minetest.line_of_sight(pos1,pos2,stepsize) ->true/false
@@ -1306,6 +1307,10 @@ minetest.get_item_group(name, group) -> rating
^ Get rating of a group of an item. (0 = not in group)
minetest.get_node_group(name, group) -> rating
^ Deprecated: An alias for the former.
+minetest.get_content_id(name) -> integer
+^ Gets the internal content ID of name
+minetest.get_name_from_content_id(content_id) -> string
+^ Gets the name of the content with that content ID
minetest.serialize(table) -> string
^ Convert a table containing tables, strings, numbers, booleans and nils
into string form readable by minetest.deserialize
@@ -1522,6 +1527,23 @@ methods:
- get2d(pos) -> 2d noise value at pos={x=,y=}
- get3d(pos) -> 3d noise value at pos={x=,y=,z=}
+VoxelManip: An interface to the MapVoxelManipulator for Lua
+- Can be created via VoxelManip()
+- Also minetest.get_voxel_manip()
+methods:
+- read_chunk(p1, p2): Read a chunk of map containing the region formed by p1 and p2.
+ ^ returns raw node data, actual emerged p1, actual emerged p2
+ ^ raw node data is in the form of a table mapping indicies to node content ids
+- write_chunk(data): Write back the data
+- update_map(): Update map after writing chunk.
+ ^ To be used only by VoxelManip objects created by the mod itself; not VoxelManips passed to callbacks
+- set_lighting(p1, p2, light): Set the lighting in the region formed by p1 and p2 to light
+ ^ light is a table containing two integer fields ranging from 0 to 15, day and night
+ ^ To be used only by VoxelManip objects passed to a callback; otherwise, set lighting will be ignored
+- calc_lighting(p1, p2): Calculate lighting in the region formed by p1 and p2
+ ^ To be used only by VoxelManip objects passed to a callback; otherwise, calculated lighting will be ignored
+- update_liquids(): Update liquid flow
+
Registered entities
--------------------
- Functions receive a "luaentity" as self: