rails.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. -- carts/rails.lua
  2. -- support for MT game translation.
  3. local S = carts.get_translator
  4. carts:register_rail("carts:rail", {
  5. description = S("Rail"),
  6. tiles = {
  7. "carts_rail_straight.png", "carts_rail_curved.png",
  8. "carts_rail_t_junction.png", "carts_rail_crossing.png"
  9. },
  10. inventory_image = "carts_rail_straight.png",
  11. wield_image = "carts_rail_straight.png",
  12. groups = carts:get_rail_groups(),
  13. }, {})
  14. minetest.register_craft({
  15. output = "carts:rail 18",
  16. recipe = {
  17. {"default:steel_ingot", "group:wood", "default:steel_ingot"},
  18. {"default:steel_ingot", "", "default:steel_ingot"},
  19. {"default:steel_ingot", "group:wood", "default:steel_ingot"},
  20. }
  21. })
  22. minetest.register_alias("default:rail", "carts:rail")
  23. carts:register_rail("carts:powerrail", {
  24. description = S("Powered Rail"),
  25. tiles = {
  26. "carts_rail_straight_pwr.png", "carts_rail_curved_pwr.png",
  27. "carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png"
  28. },
  29. groups = carts:get_rail_groups(),
  30. }, {acceleration = 5})
  31. minetest.register_craft({
  32. output = "carts:powerrail 18",
  33. recipe = {
  34. {"default:steel_ingot", "group:wood", "default:steel_ingot"},
  35. {"default:steel_ingot", "default:mese_crystal", "default:steel_ingot"},
  36. {"default:steel_ingot", "group:wood", "default:steel_ingot"},
  37. }
  38. })
  39. carts:register_rail("carts:brakerail", {
  40. description = S("Brake Rail"),
  41. tiles = {
  42. "carts_rail_straight_brk.png", "carts_rail_curved_brk.png",
  43. "carts_rail_t_junction_brk.png", "carts_rail_crossing_brk.png"
  44. },
  45. groups = carts:get_rail_groups(),
  46. }, {acceleration = -3})
  47. minetest.register_craft({
  48. output = "carts:brakerail 18",
  49. recipe = {
  50. {"default:steel_ingot", "group:wood", "default:steel_ingot"},
  51. {"default:steel_ingot", "default:coal_lump", "default:steel_ingot"},
  52. {"default:steel_ingot", "group:wood", "default:steel_ingot"},
  53. }
  54. })