1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 00:20:17 +01:00

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

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