init.lua 1.5 KB

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