Don't allow placement of tetris in protected areas.

Tested with "protector".
This commit is contained in:
Auke Kok 2016-03-27 22:51:01 -07:00
parent 9b61d2082b
commit 9a4a0e934c
1 changed files with 4 additions and 0 deletions

View File

@ -270,6 +270,10 @@ minetest.register_node("computer:tetris_arcade", {
end,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if minetest.is_protected(pos, placer:get_player_name()) or
minetest.is_protected({x=pos.x, y=pos.y+1, z=pos.z}, placer:get_player_name()) then
return itemstack
end
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.chat_send_player(placer:get_player_name(), "No room for place the Arcade!")
return end