privs.lua 809 B

12345678910111213141516171819202122
  1. local S = minetest.get_translator("travelnet")
  2. minetest.register_on_mods_loaded(function()
  3. if travelnet.attach_priv == "travelnet_attach" then
  4. minetest.register_privilege("travelnet_attach", {
  5. description = S("allows to attach travelnet boxes to travelnets of other players"),
  6. give_to_singleplayer = false
  7. })
  8. elseif not minetest.registered_privileges[travelnet.attach_priv] then
  9. error("custom attach priv is not registered!")
  10. end
  11. if travelnet.remove_priv == "travelnet_remove" then
  12. minetest.register_privilege("travelnet_remove", {
  13. description = S("allows to dig travelnet boxes which belog to nets of other players"),
  14. give_to_singleplayer = false
  15. })
  16. elseif not minetest.registered_privileges[travelnet.remove_priv] then
  17. error("custom remove priv is not registered!")
  18. end
  19. end)