init.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Sprint mod for Minetest by GunshipPenguin
  3. To the extent possible under law, the author(s)
  4. have dedicated all copyright and related and neighboring rights
  5. to this software to the public domain worldwide. This software is
  6. distributed without any warranty.
  7. ]]
  8. sprint = sprint or {}
  9. sprint.modpath = minetest.get_modpath("sprint")
  10. -- Configuration variables, these are all explained in README.md
  11. SPRINT_METHOD = 1
  12. SPRINT_SPEED = 1.45
  13. SPRINT_JUMP = 1.2
  14. SPRINT_STAMINA = 60
  15. SPRINT_HUD_ICONS = 46
  16. dofile(sprint.modpath .. "/esprint.lua")
  17. if not sprint.registered then
  18. minetest.register_on_joinplayer(function(...)
  19. return sprint.on_joinplayer(...)
  20. end)
  21. minetest.register_on_leaveplayer(function(...)
  22. return sprint.on_leaveplayer(...)
  23. end)
  24. minetest.register_on_respawnplayer(function(...)
  25. return sprint.on_respawnplayer(...)
  26. end)
  27. minetest.register_globalstep(function(...)
  28. return sprint.globalstep(...)
  29. end)
  30. local c = "sprint:core"
  31. local f = sprint.modpath .. "/init.lua"
  32. reload.register_file(c, f, false)
  33. sprint.registered = true
  34. end