1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add oldnode parameter to minetest.register_on_placenode callback

This commit is contained in:
Perttu Ahola 2012-07-23 20:44:56 +03:00
parent c009aa3a22
commit e8331f0c1d
2 changed files with 5 additions and 4 deletions

View file

@ -152,7 +152,8 @@ function minetest.item_place_node(itemstack, placer, pointed_thing)
minetest.log("action", placer:get_player_name() .. " places node "
.. def.name .. " at " .. minetest.pos_to_string(place_to))
local oldnode = minetest.env:get_node(place_to)
local newnode = {name = def.name, param1 = 0, param2 = 0}
-- Calculate direction for wall mounted stuff like torches and signs
@ -188,7 +189,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing)
-- Run script hook (deprecated)
local _, callback
for _, callback in ipairs(minetest.registered_on_placenodes) do
callback(place_to, newnode, placer)
callback(place_to, newnode, placer, oldnode)
end
itemstack:take_item()