From 731392866f3f2595a08ca279b1d39584f6783ec0 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Wed, 11 Sep 2013 16:32:05 +0200 Subject: Allow to manually specify param2 in minetest.item_place() and return success --- doc/lua_api.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 43c719a43..06230eaa7 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1361,14 +1361,18 @@ minetest.rollback_revert_actions_by(actor, seconds) -> bool, log messages Defaults for the on_* item definition functions: (These return the leftover itemstack) -minetest.item_place_node(itemstack, placer, pointed_thing) +minetest.item_place_node(itemstack, placer, pointed_thing, param2) ^ Place item as a node +^ param2 overrides facedir and wallmounted param2 +^ returns itemstack, success minetest.item_place_object(itemstack, placer, pointed_thing) ^ Place item as-is -minetest.item_place(itemstack, placer, pointed_thing) +minetest.item_place(itemstack, placer, pointed_thing, param2) ^ Use one of the above based on what the item is. ^ 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 +^ returns itemstack, success minetest.item_drop(itemstack, dropper, pos) ^ Drop the item minetest.item_eat(hp_change, replace_with_item) -- cgit v1.2.3