Add special group hanging_node

- hanging_node: drops node(s) beneath it if they contain hanging_node group. Can only place node when top node is haning_node or walkable true
master
Bas 2013-04-11 02:48:46 +03:00
parent dda2071cc0
commit 2dc5f134b3
1 changed files with 11 additions and 0 deletions

View File

@ -161,6 +161,17 @@ function nodeupdate_single(p, delay)
end
end
if minetest.get_node_group(n.name, "hanging_node") ~= 0 then
p_top = {x=p.x, y=p.y+1, z=p.z}
n_top = minetest.env:get_node(p_top)
if minetest.registered_nodes[n_top.name].walkable == true then return end
if minetest.get_node_group(n_top.name, "hanging_node") ~= 0 == false then
drop_attached_node(p)
nodeupdate(p)
end
return
end
if minetest.get_node_group(n.name, "attached_node") ~= 0 then
if not check_attached_node(p, n) then
drop_attached_node(p)