summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorraymoo <raymoo@users.noreply.github.com>2017-10-28 01:30:50 -0700
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-10-28 10:30:50 +0200
commita5d5728f241fec8644ba65cb3b98c7dd1be2eee3 (patch)
treedae56e378a51682f5ae9790cb3346e63fbed764a /doc
parent2efccb353625de9c25babd0387be23f9d4829871 (diff)
downloadminetest-a5d5728f241fec8644ba65cb3b98c7dd1be2eee3.tar.gz
minetest-a5d5728f241fec8644ba65cb3b98c7dd1be2eee3.tar.bz2
minetest-a5d5728f241fec8644ba65cb3b98c7dd1be2eee3.zip
Fix default item callbacks to work with nil users (#5819)
* Fix default item callbacks to work with nil users * item.lua: Handle node drops for invalid players The if-condition for the dropping loop is the same as `inv`, which means that the 2nd possible definition of `give_item` is never used. Remove redundant `local _, dropped_item`
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index eaec90492..6109f082b 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2444,6 +2444,7 @@ Call these functions only at load time!
* `minetest.register_on_placenode(func(pos, newnode, placer, oldnode, itemstack, pointed_thing))`
* Called when a node has been placed
* If return `true` no item is taken from `itemstack`
+ * `placer` may be any valid ObjectRef or nil.
* **Not recommended**; use `on_construct` or `after_place_node` in node definition
whenever possible
* `minetest.register_on_dignode(func(pos, oldnode, digger))`
@@ -3219,6 +3220,7 @@ These functions return the leftover itemstack.
* Returns true, if player `name` shouldn't be abled to dig at `pos` or do other
actions, defineable by mods, due to some mod-defined ownership-like concept.
Returns false or nil, if the player is allowed to do such actions.
+ * `name` will be "" for non-players or unknown players.
* This function should be overridden by protection mods and should be used to
check if a player can interact at a position.
* This function should call the old version of itself if the position is not
@@ -4608,6 +4610,7 @@ Definition tables
^ Called after constructing node when node was placed using
minetest.item_place_node / minetest.place_node
^ If return true no item is taken from itemstack
+ ^ `placer` may be any valid ObjectRef or nil
^ default: nil ]]
after_dig_node = func(pos, oldnode, oldmetadata, digger), --[[
^ oldmetadata is in table format