init.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. recall = recall or {}
  2. recall.modpath = minetest.get_modpath("recall")
  3. local function central(player)
  4. local pos = {x=0, y=-3, z=0}
  5. if player:get_pos().y < -25000 then
  6. pos.y = -30788
  7. end
  8. return pos
  9. end
  10. local function north(player)
  11. local pos = {x=0, y=-3, z=198}
  12. if player:get_pos().y < -25000 then
  13. pos.y = -30788
  14. end
  15. return pos
  16. end
  17. local function south(player)
  18. local pos = {x=0, y=-3, z=-198}
  19. if player:get_pos().y < -25000 then
  20. pos.y = -30788
  21. end
  22. return pos
  23. end
  24. local function east(player)
  25. local pos = {x=198, y=-3, z=0}
  26. if player:get_pos().y < -25000 then
  27. pos.y = -30788
  28. end
  29. return pos
  30. end
  31. local function west(player)
  32. local pos = {x=-198, y=-3, z=0}
  33. if player:get_pos().y < -25000 then
  34. pos.y = -30788
  35. end
  36. return pos
  37. end
  38. local recalls = {
  39. {name="Central Square", position=central, min_dist=20},
  40. {name="West Quarter", position=west, min_dist=20},
  41. {name="East Quarter", position=east, min_dist=20},
  42. {name="North Quarter", position=north, min_dist=20},
  43. {name="South Quarter", position=south, min_dist=20},
  44. }
  45. for k, v in pairs(recalls) do
  46. passport.register_recall(v)
  47. end