init.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ropes = {
  2. name = 'ropes',
  3. }
  4. -- internationalization boilerplate
  5. local MP = minetest.get_modpath(minetest.get_current_modname())
  6. local S, NS = dofile(MP.."/intllib.lua")
  7. ropes.ropeLength = tonumber(minetest.settings:get("ropes_rope_length")) or 50
  8. ropes.woodRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_wood_rope_box_max_multiple")) or 2
  9. ropes.copperRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_copper_rope_box_max_multiple")) or 5
  10. ropes.steelRopeBoxMaxMultiple = tonumber(minetest.settings:get("ropes_steel_rope_box_max_multiple")) or 9
  11. ropes.create_all_definitions = minetest.settings:get_bool("ropes_create_all_definitions")
  12. ropes.ropeLadderLength = tonumber(minetest.settings:get("ropes_rope_ladder_length")) or 50
  13. ropes.extending_ladder_enabled = minetest.settings:get_bool("ropes_extending_ladder_enabled")
  14. if ropes.extending_ladder_enabled == nil then
  15. ropes.extending_ladder_enabled = true
  16. end
  17. ropes.replace_default_ladders = minetest.settings:get_bool("ropes_replace_default_ladders")
  18. ropes.extending_wood_ladder_limit = tonumber(minetest.settings:get("ropes_extending_wood_ladder_limit")) or 5
  19. ropes.extending_steel_ladder_limit = tonumber(minetest.settings:get("ropes_extending_steel_ladder_limit")) or 15
  20. ropes.bridges_enabled = minetest.settings:get_bool("ropes_bridges_enabled")
  21. if ropes.bridges_enabled == nil then
  22. ropes.bridges_enabled = true
  23. end
  24. ropes.can_extend_into_airlike = minetest.settings:get_bool("ropes_can_extend_into_airlike")
  25. ropes.can_extend_into_nodes = {["air"] = true}
  26. if minetest.get_modpath("nether") then
  27. ropes.can_extend_into_nodes["nether:fumes"] = true
  28. end
  29. dofile( MP .. "/doc.lua" )
  30. dofile( MP .. "/functions.lua" )
  31. dofile( MP .. "/crafts.lua" )
  32. dofile( MP .. "/ropeboxes.lua" )
  33. dofile( MP .. "/ropeladder.lua" )
  34. dofile( MP .. "/extendingladder.lua" )
  35. dofile( MP .. "/bridge.lua" )
  36. dofile( MP .. "/loot.lua" )
  37. for i=1,5 do
  38. minetest.register_alias(string.format("vines:%irope_block", i), string.format("ropes:%irope_block", i))
  39. end
  40. minetest.register_alias("vines:rope", "ropes:rope")
  41. minetest.register_alias("vines:rope_bottom", "ropes:rope_bottom")
  42. minetest.register_alias("vines:rope_end", "ropes:rope_bottom")
  43. minetest.register_alias("vines:rope_top", "ropes:rope_top")
  44. minetest.register_alias("vines:ropeladder_top", "ropes:ropeladder_top")
  45. minetest.register_alias("vines:ropeladder", "ropes:ropeladder")
  46. minetest.register_alias("vines:ropeladder_bottom", "ropes:ropeladder_bottom")
  47. minetest.register_alias("vines:ropeladder_falling", "ropes:ropeladder_falling")
  48. minetest.register_alias("vines:rope_block", "ropes:steel5rope_block")
  49. for i=1,9 do
  50. minetest.register_alias(string.format("ropes:%irope_block", i), string.format("ropes:steel%irope_block", i))
  51. end
  52. minetest.register_alias("castle:ropes", "ropes:rope")
  53. minetest.register_alias("castle:ropebox", "ropes:steel1rope_block")
  54. minetest.register_alias("castle:box_rope", "ropes:rope")
  55. print("[Ropes] Loaded!")