mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-23 08:20:21 +01:00
Don't allow placement of tetris in protected areas.
Tested with "protector".
This commit is contained in:
parent
9b61d2082b
commit
9a4a0e934c
@ -270,6 +270,10 @@ minetest.register_node("computer:tetris_arcade", {
|
|||||||
end,
|
end,
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
local pos = pointed_thing.above
|
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
|
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!")
|
minetest.chat_send_player(placer:get_player_name(), "No room for place the Arcade!")
|
||||||
return end
|
return end
|
||||||
|
Loading…
Reference in New Issue
Block a user