Correct documentation around minetest.item_place
The code that calls minetest.item_place_object was removed in 2013 in commit fc61c8809b9a1d47d9f117446764107a56cec956.
This commit is contained in:
parent
b50dc43f67
commit
db7e59f472
@ -398,6 +398,7 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
|
|||||||
return itemstack, true
|
return itemstack, true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- deprecated, item_place does not call this
|
||||||
function core.item_place_object(itemstack, placer, pointed_thing)
|
function core.item_place_object(itemstack, placer, pointed_thing)
|
||||||
local pos = core.get_pointed_thing_position(pointed_thing, true)
|
local pos = core.get_pointed_thing_position(pointed_thing, true)
|
||||||
if pos ~= nil then
|
if pos ~= nil then
|
||||||
@ -419,6 +420,7 @@ function core.item_place(itemstack, placer, pointed_thing, param2)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Place if node, otherwise do nothing
|
||||||
if itemstack:get_definition().type == "node" then
|
if itemstack:get_definition().type == "node" then
|
||||||
return core.item_place_node(itemstack, placer, pointed_thing, param2)
|
return core.item_place_node(itemstack, placer, pointed_thing, param2)
|
||||||
end
|
end
|
||||||
|
@ -4851,10 +4851,8 @@ Rollback
|
|||||||
* Revert latest actions of someone
|
* Revert latest actions of someone
|
||||||
* `actor`: `"player:<name>"`, also `"liquid"`.
|
* `actor`: `"player:<name>"`, also `"liquid"`.
|
||||||
|
|
||||||
Defaults for the `on_*` item definition functions
|
Defaults for the `on_place` and `on_drop` item definition functions
|
||||||
-------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
These functions return the leftover itemstack.
|
|
||||||
|
|
||||||
* `minetest.item_place_node(itemstack, placer, pointed_thing[, param2, prevent_after_place])`
|
* `minetest.item_place_node(itemstack, placer, pointed_thing[, param2, prevent_after_place])`
|
||||||
* Place item as a node
|
* Place item as a node
|
||||||
@ -4864,20 +4862,23 @@ These functions return the leftover itemstack.
|
|||||||
* returns `itemstack, success`
|
* returns `itemstack, success`
|
||||||
* `minetest.item_place_object(itemstack, placer, pointed_thing)`
|
* `minetest.item_place_object(itemstack, placer, pointed_thing)`
|
||||||
* Place item as-is
|
* Place item as-is
|
||||||
* `minetest.item_place(itemstack, placer, pointed_thing, param2)`
|
* returns the leftover itemstack
|
||||||
* Use one of the above based on what the item is.
|
* **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
|
* Calls `on_rightclick` of `pointed_thing.under` if defined instead
|
||||||
* **Note**: is not called when wielded item overrides `on_place`
|
* **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`
|
* returns `itemstack, success`
|
||||||
* `minetest.item_drop(itemstack, dropper, pos)`
|
* `minetest.item_drop(itemstack, dropper, pos)`
|
||||||
* Drop the item
|
* Drop the item
|
||||||
* `minetest.item_eat(hp_change, replace_with_item)`
|
* returns the leftover itemstack
|
||||||
* Eat the item.
|
* `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.
|
* `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
|
If the player is eating a stack, then replace_with_item goes to a
|
||||||
different spot. Can be `nil`
|
different spot.
|
||||||
* See `minetest.do_item_eat`
|
|
||||||
|
|
||||||
Defaults for the `on_punch` and `on_dig` node definition callbacks
|
Defaults for the `on_punch` and `on_dig` node definition callbacks
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user