1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-26 18:21:04 +00:00

Add the group attached_node

Nodes in this group will be dropped as items if the node under them or the node in the wallmounted direction is not walkable.
This commit is contained in:
PilzAdam 2012-12-01 13:32:32 +01:00
parent bb454b1846
commit fa76057e7f
4 changed files with 63 additions and 4 deletions

View file

@ -181,6 +181,13 @@ function minetest.item_place_node(itemstack, placer, pointed_thing)
end
end
-- Check if the node is attached and if it can be placed there
if not check_attached_node(place_to, newnode) then
minetest.log("action", "attached node " .. def.name ..
" can not be placed at " .. minetest.pos_to_string(place_to))
return
end
-- Add node and update
minetest.env:add_node(place_to, newnode)