1
0
mirror of https://github.com/Sokomine/locks.git synced 2024-09-27 06:00:18 +02:00
This commit is contained in:
Sokomine 2018-07-30 18:59:28 +02:00
commit 81d5b7613a

View File

@ -142,7 +142,10 @@ minetest.register_node("locks:door", {
sunlight_propogates = true,
on_place = function(itemstack, placer, pointed_thing)
local above = pointed_thing.above
if minetest.is_protected(above, placer:get_player_name()) then
minetest.chat_send_player(placer:get_player_name(), "This area is protected!")
return itemstack
else
-- there should be 2 empty nodes
if minetest.env:get_node({x = above.x, y = above.y + 1, z = above.z}).name ~= "air" then
return itemstack
@ -175,6 +178,7 @@ minetest.register_node("locks:door", {
return ItemStack("")
end
end
})