Add is_protected_action in Protection Block placing

This commit is contained in:
MoNTE48 2019-09-10 19:49:08 +02:00
parent e5f6097714
commit a845b1adda

View File

@ -37,6 +37,8 @@ minetest.register_node(":areasprotector:protector", {
local pos1 = vector.add(pos, vector.new(radius, radius, radius))
local pos2 = vector.add(pos, vector.new(-1 * radius, -1 * radius, -1 * radius))
local name = player:get_player_name()
if not minetest.is_protected_action(pos, name) then
local perm, err = areas:canPlayerAddArea(pos1, pos2, name)
if not perm then
minetest.chat_send_player(name, red("You are not allowed to protect that area: ") .. err)
@ -54,6 +56,7 @@ minetest.register_node(":areasprotector:protector", {
meta:set_string("owner", name)
itemstack:take_item()
return itemstack
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)