mirror of
https://github.com/minetest-mods/areas.git
synced 2025-07-07 02:20:22 +02:00
Display owner group names on failed interaction
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
|
||||
local old_is_protected = minetest.is_protected
|
||||
function minetest.is_protected(pos, name)
|
||||
if not areas:canInteract(pos, name) then
|
||||
@ -10,6 +9,11 @@ end
|
||||
minetest.register_on_protection_violation(function(pos, name)
|
||||
if not areas:canInteract(pos, name) then
|
||||
local owners = areas:getNodeOwners(pos)
|
||||
|
||||
if not owners[1] then
|
||||
owners = areas:getNodeOwnerGroups(pos)
|
||||
end
|
||||
|
||||
minetest.chat_send_player(name,
|
||||
("%s is protected by %s."):format(
|
||||
minetest.pos_to_string(pos),
|
||||
|
Reference in New Issue
Block a user