diff options
author | PilzAdam <adam-k@outlook.com> | 2012-12-17 19:49:18 +0100 |
---|---|---|
committer | PilzAdam <adam-k@outlook.com> | 2012-12-17 19:49:18 +0100 |
commit | 29c17c14f1ef42f8080a44b1e3308f34de8b5df2 (patch) | |
tree | c62289a707f2311e70fd72aad70d2cf8e01286f8 /doc | |
parent | f4ed37ec6f1d24c2da3dab14b3478d3b0452d7aa (diff) | |
download | minetest-29c17c14f1ef42f8080a44b1e3308f34de8b5df2.tar.gz minetest-29c17c14f1ef42f8080a44b1e3308f34de8b5df2.tar.bz2 minetest-29c17c14f1ef42f8080a44b1e3308f34de8b5df2.zip |
Add ability to change the itemstack in placenode callbacks
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 60d1b2cb9..a9944935f 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -810,8 +810,9 @@ minetest.register_on_shutdown(func()) ^ WARNING: If the server terminates abnormally (i.e. crashes), the registered callbacks WILL LIKELY NOT BE RUN. Data should be saved at semi-frequent intervals as well as on server shutdown. -minetest.register_on_placenode(func(pos, newnode, placer, oldnode)) +minetest.register_on_placenode(func(pos, newnode, placer, oldnode, itemstack)) ^ Called when a node has been placed +^ If return true no item is taken from itemstack ^ Deprecated: Use on_construct or after_place_node in node definition instead minetest.register_on_dignode(func(pos, oldnode, digger)) ^ Called when a node has been dug. @@ -1405,9 +1406,10 @@ Node definition (register_node) ^ Node destructor; always called after removing node ^ default: nil - after_place_node = func(pos, placer), + after_place_node = func(pos, placer, itemstack), ^ Called after constructing node when node was placed using minetest.item_place_node / minetest.env:place_node + ^ If return true no item is taken from itemstack ^ default: nil after_dig_node = func(pos, oldnode, oldmetadata, digger), ^ oldmetadata is in table format |