mirror of
https://github.com/Sokomine/locks.git
synced 2025-01-09 07:10:21 +01:00
Merge branch 'master' of https://github.com/Sokomine/locks
This commit is contained in:
commit
81d5b7613a
@ -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
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user