A rewrite of the node_ownership Minetest mod with many new features. https://content.minetest.net/packages/ShadowNinja/areas/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
523B

  1. local S = minetest.get_translator("areas")
  2. local old_is_protected = minetest.is_protected
  3. function minetest.is_protected(pos, name)
  4. if not areas:canInteract(pos, name) then
  5. return true
  6. end
  7. return old_is_protected(pos, name)
  8. end
  9. minetest.register_on_protection_violation(function(pos, name)
  10. if not areas:canInteract(pos, name) then
  11. local owners = areas:getNodeOwners(pos)
  12. minetest.chat_send_player(name,
  13. S("@1 is protected by @2.",
  14. minetest.pos_to_string(pos),
  15. table.concat(owners, ", ")))
  16. end
  17. end)