init.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
  2. -- Check for translation method
  3. local S
  4. if minetest.get_translator ~= nil then
  5. S = minetest.get_translator("mobs_animal") -- 5.x translation function
  6. else
  7. if minetest.get_modpath("intllib") then
  8. dofile(minetest.get_modpath("intllib") .. "/init.lua")
  9. if intllib.make_gettext_pair then
  10. S = intllib.make_gettext_pair() -- new gettext method
  11. else
  12. S = intllib.Getter() -- old text file method
  13. end
  14. else -- boilerplate function
  15. S = function(str, ...)
  16. local args = {...}
  17. return str:gsub("@%d+", function(match)
  18. return args[tonumber(match:sub(2))]
  19. end)
  20. end
  21. end
  22. end
  23. mobs.intllib_animal = S
  24. -- Check for custom mob spawn file
  25. local input = io.open(path .. "spawn.lua", "r")
  26. if input then
  27. mobs.custom_spawn_animal = true
  28. input:close()
  29. input = nil
  30. end
  31. -- Animals
  32. dofile(path .. "chicken.lua") -- JKmurray
  33. dofile(path .. "cow.lua") -- KrupnoPavel
  34. dofile(path .. "rat.lua") -- PilzAdam
  35. dofile(path .. "sheep.lua") -- PilzAdam
  36. dofile(path .. "warthog.lua") -- KrupnoPavel
  37. dofile(path .. "bee.lua") -- KrupnoPavel
  38. dofile(path .. "bunny.lua") -- ExeterDad
  39. dofile(path .. "kitten.lua") -- Jordach/BFD
  40. dofile(path .. "penguin.lua") -- D00Med
  41. dofile(path .. "panda.lua") -- AspireMint
  42. -- Load custom spawning
  43. if mobs.custom_spawn_animal then
  44. dofile(path .. "spawn.lua")
  45. end
  46. -- Lucky Blocks
  47. if minetest.get_modpath("lucky_block") then
  48. dofile(path .. "lucky_block.lua")
  49. end
  50. print ("[MOD] Mobs Redo Animals loaded")