Dont place doors if node under it has on_rightclick
This commit is contained in:
parent
230747c748
commit
6c70e0295a
@ -41,6 +41,13 @@ function doors:register_door(name, def)
|
|||||||
if not pointed_thing.type == "node" then
|
if not pointed_thing.type == "node" then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local ptu = pointed_thing.under
|
||||||
|
local nu = minetest.env:get_node(ptu)
|
||||||
|
if minetest.registered_nodes[nu.name].on_rightclick then
|
||||||
|
return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack)
|
||||||
|
end
|
||||||
|
|
||||||
local pt = pointed_thing.above
|
local pt = pointed_thing.above
|
||||||
local pt2 = {x=pt.x, y=pt.y, z=pt.z}
|
local pt2 = {x=pt.x, y=pt.y, z=pt.z}
|
||||||
pt2.y = pt2.y+1
|
pt2.y = pt2.y+1
|
||||||
|
Loading…
Reference in New Issue
Block a user