diff options
author | sfan5 <sfan5@live.de> | 2019-12-16 19:13:43 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-12-16 21:24:34 +0100 |
commit | db7e59f4725a9516314ea0148d1bcaf250280e32 (patch) | |
tree | 6f442b72d357d75cf3ff8ee7b4dfcaddeca8458a /doc/lua_api.txt | |
parent | b50dc43f67332e24c93dd8ea8edb8654d4753b11 (diff) | |
download | minetest-db7e59f4725a9516314ea0148d1bcaf250280e32.tar.gz minetest-db7e59f4725a9516314ea0148d1bcaf250280e32.tar.bz2 minetest-db7e59f4725a9516314ea0148d1bcaf250280e32.zip |
Correct documentation around minetest.item_place
The code that calls minetest.item_place_object was removed
in 2013 in commit fc61c8809b9a1d47d9f117446764107a56cec956.
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r-- | doc/lua_api.txt | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index cb92ea7b8..ca59aad95 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -4851,10 +4851,8 @@ Rollback * Revert latest actions of someone * `actor`: `"player:<name>"`, also `"liquid"`. -Defaults for the `on_*` item definition functions -------------------------------------------------- - -These functions return the leftover itemstack. +Defaults for the `on_place` and `on_drop` item definition functions +------------------------------------------------------------------- * `minetest.item_place_node(itemstack, placer, pointed_thing[, param2, prevent_after_place])` * Place item as a node @@ -4864,20 +4862,23 @@ These functions return the leftover itemstack. * returns `itemstack, success` * `minetest.item_place_object(itemstack, placer, pointed_thing)` * Place item as-is -* `minetest.item_place(itemstack, placer, pointed_thing, param2)` - * Use one of the above based on what the item is. + * returns the leftover itemstack + * **Note**: This function is deprecated and will never be called. +* `minetest.item_place(itemstack, placer, pointed_thing[, param2])` + * Wrapper that calls `minetest.item_place_node` if appropriate * Calls `on_rightclick` of `pointed_thing.under` if defined instead * **Note**: is not called when wielded item overrides `on_place` - * `param2` overrides `facedir` and wallmounted `param2` + * `param2` overrides facedir and wallmounted `param2` * returns `itemstack, success` * `minetest.item_drop(itemstack, dropper, pos)` * Drop the item -* `minetest.item_eat(hp_change, replace_with_item)` - * Eat the item. + * returns the leftover itemstack +* `minetest.item_eat(hp_change[, replace_with_item])` + * Returns `function(itemstack, user, pointed_thing)` as a + function wrapper for `minetest.do_item_eat`. * `replace_with_item` is the itemstring which is added to the inventory. If the player is eating a stack, then replace_with_item goes to a - different spot. Can be `nil` - * See `minetest.do_item_eat` + different spot. Defaults for the `on_punch` and `on_dig` node definition callbacks ------------------------------------------------------------------ |