init.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. -- Load support for intllib.
  2. local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
  3. -- Check for translation method
  4. local S
  5. if minetest.get_translator ~= nil then
  6. S = minetest.get_translator("mobs_monster") -- 5.x translation function
  7. else
  8. if minetest.get_modpath("intllib") then
  9. dofile(minetest.get_modpath("intllib") .. "/init.lua")
  10. if intllib.make_gettext_pair then
  11. S = intllib.make_gettext_pair() -- new gettext method
  12. else
  13. S = intllib.Getter() -- old text file method
  14. end
  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_monster = 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_monster = true
  29. input:close()
  30. input = nil
  31. end
  32. -- Monsters
  33. dofile(path .. "dirt_monster.lua") -- PilzAdam
  34. dofile(path .. "dungeon_master.lua")
  35. dofile(path .. "oerkki.lua")
  36. dofile(path .. "sand_monster.lua")
  37. dofile(path .. "stone_monster.lua")
  38. dofile(path .. "tree_monster.lua")
  39. dofile(path .. "lava_flan.lua") -- Zeg9
  40. dofile(path .. "mese_monster.lua")
  41. dofile(path .. "spider.lua") -- AspireMint
  42. dofile(path .. "land_guard.lua")
  43. dofile(path .. "fire_spirit.lua")
  44. -- Load custom spawning
  45. if mobs.custom_spawn_monster then
  46. dofile(path .. "spawn.lua")
  47. end
  48. -- Lucky Blocks
  49. if minetest.get_modpath("lucky_block") then
  50. dofile(path .. "lucky_block.lua")
  51. end
  52. print ("[MOD] Mobs Redo Monsters loaded")