summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-06-02 00:33:51 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-06-03 22:31:01 +0300
commitaba7134301e0fe49cb3a6b157d226e1405753237 (patch)
tree32b35873b359483a34babe416ea654f9fe9471ac /doc/lua_api.txt
parentd7447cdf9e4df3c345218886ab2bae0e0cc4fc55 (diff)
downloadminetest-aba7134301e0fe49cb3a6b157d226e1405753237.tar.gz
minetest-aba7134301e0fe49cb3a6b157d226e1405753237.tar.bz2
minetest-aba7134301e0fe49cb3a6b157d226e1405753237.zip
on_metadata_inventory_{move,offer,take}
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 73d7b3641..f8615b130 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1039,7 +1039,38 @@ Node definition (register_node)
on_receive_fields = func(pos, formname, fields, sender),
^ fields = {name1 = value1, name2 = value2, ...}
+ ^ Called when an UI form (eg. sign text input) returns data
^ default: nil
+
+ on_metadata_inventory_move = func(pos, from_list, from_index,
+ to_list, to_index, count, player),
+ ^ Called when a player wants to move items inside the metadata
+ ^ Should move items, or some items, if permitted. If not, should do
+ nothing.
+ ^ The engine ensures the action is valid, i.e. the stack fits at the
+ given position
+ ^ default: minetest.node_metadata_inventory_move_allow_all
+
+ on_metadata_inventory_offer = func(pos, listname, index, stack, player),
+ ^ Called when a player wants to put something into the metadata
+ inventory
+ ^ Should check if the action is permitted (the engine ensures the
+ action is valid, i.e. the stack fits at the given position)
+ ^ If permitted, modify the metadata inventory and return the
+ "leftover" stack (normally nil).
+ ^ If not permitted, return itemstack.
+ ^ default: minetest.node_metadata_inventory_offer_allow_all
+
+ on_metadata_inventory_take = func(pos, listname, index, count, player),
+ ^ Called when a player wants to take something out of the metadata
+ inventory
+ ^ Should check if the action is permitted (the engine ensures the
+ action is valid, i.e. there's a stack of at least “count” items at
+ that position)
+ ^ If permitted, modify the metadata inventory and return the
+ stack of items
+ ^ If not permitted, return nil.
+ ^ default: minetest.node_metadata_inventory_take_allow_all
}
Recipe: (register_craft)