init.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. if not minetest.global_exists("sprint") then sprint = {} end
  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. SPRINT_USE_RATE = 3
  17. dofile(sprint.modpath .. "/esprint.lua")
  18. if not sprint.registered then
  19. minetest.register_on_joinplayer(function(...)
  20. return sprint.on_joinplayer(...)
  21. end)
  22. minetest.register_on_leaveplayer(function(...)
  23. return sprint.on_leaveplayer(...)
  24. end)
  25. minetest.register_on_respawnplayer(function(...)
  26. return sprint.on_respawnplayer(...)
  27. end)
  28. minetest.register_globalstep(function(...)
  29. return sprint.globalstep(...)
  30. end)
  31. local c = "sprint:core"
  32. local f = sprint.modpath .. "/init.lua"
  33. reload.register_file(c, f, false)
  34. sprint.registered = true
  35. end