diff options
author | PilzAdam <adam-k@outlook.com> | 2012-12-01 13:32:32 +0100 |
---|---|---|
committer | PilzAdam <adam-k@outlook.com> | 2012-12-01 13:32:32 +0100 |
commit | fa76057e7f6811a8e7388a70d6fde7af61aa0bee (patch) | |
tree | 4e24bbecd4951a116d97405225149f14ac8c92d9 /builtin/item.lua | |
parent | bb454b184656735b51fea17a0cb6276514b1c8c1 (diff) | |
download | minetest-fa76057e7f6811a8e7388a70d6fde7af61aa0bee.tar.gz minetest-fa76057e7f6811a8e7388a70d6fde7af61aa0bee.tar.bz2 minetest-fa76057e7f6811a8e7388a70d6fde7af61aa0bee.zip |
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.
Diffstat (limited to 'builtin/item.lua')
-rw-r--r-- | builtin/item.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/item.lua b/builtin/item.lua index 0f8dcff1f..9352a43fc 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -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) |