init.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. meseconductors = {}
  2. local modpath=minetest.get_modpath("meseconductors")
  3. local worldpath=minetest.get_worldpath()
  4. dofile(modpath.."/default_settings.txt")
  5. if io.open(worldpath.."/meseconductors_settings.txt","r") == nil then
  6. io.input(modpath.."/default_settings.txt")
  7. io.output(worldpath.."/meseconductors_settings.txt")
  8. local size = 2^13 -- good buffer size (8K)
  9. while true do
  10. local block = io.read(size)
  11. if not block then
  12. io.close()
  13. break
  14. end
  15. io.write(block)
  16. end
  17. else
  18. dofile(worldpath.."/meseconductors_settings.txt")
  19. end
  20. local S -- Load translation library if intllib is installed:
  21. if intllib then
  22. S = intllib.Getter(minetest.get_current_modname())
  23. else
  24. S = function(s) return s end
  25. end
  26. meseconductors.gettext = S
  27. dofile(minetest.get_modpath("meseconductors").."/lamps.lua")
  28. dofile(minetest.get_modpath("meseconductors").."/nodes.lua")
  29. dofile(minetest.get_modpath("meseconductors").."/crafting.lua")
  30. dofile(minetest.get_modpath("meseconductors").."/lightstones.lua")