mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-12-20 00:35:47 +01:00
initial commit
subgame + mods
This commit is contained in:
19
mods/areas/interact.lua
Executable file
19
mods/areas/interact.lua
Executable file
@@ -0,0 +1,19 @@
|
||||
|
||||
local old_is_protected = minetest.is_protected
|
||||
function minetest.is_protected(pos, name)
|
||||
if not areas:canInteract(pos, name) then
|
||||
return true
|
||||
end
|
||||
return old_is_protected(pos, name)
|
||||
end
|
||||
|
||||
minetest.register_on_protection_violation(function(pos, name)
|
||||
if not areas:canInteract(pos, name) then
|
||||
local owners = areas:getNodeOwners(pos)
|
||||
minetest.chat_send_player(name,
|
||||
("%s is protected by %s."):format(
|
||||
minetest.pos_to_string(pos),
|
||||
table.concat(owners, ", ")))
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user