init.lua 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. local S
  2. if minetest.get_modpath("intllib") then
  3. S = intllib.Getter()
  4. else
  5. S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
  6. end
  7. advtrains.register_wagon("moretrains_wagon_tank", {
  8. mesh="moretrains_wagon_tank.b3d",
  9. textures = {"moretrains_wagon_tank.png"},
  10. seats = {},
  11. drives_on={default=true},
  12. max_speed=20,
  13. visual_size = {x=1, y=1},
  14. wagon_span=2.719,
  15. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  16. drops={"default:steelblock 2"},
  17. has_inventory = true,
  18. get_inventory_formspec = function(self, pname, invname)
  19. return "size[8,11]"..
  20. "list["..invname..";box;0,0;8,3;]"..
  21. "list[current_player;main;0,5;8,4;]"..
  22. "listring[]"
  23. end,
  24. inventory_list_sizes = {
  25. box=8*3,
  26. },
  27. }, S("Industrial tank wagon (silver)"), "moretrains_wagon_tank_inv.png")
  28. advtrains.register_wagon("moretrains_wagon_tank2", {
  29. mesh="moretrains_wagon_tank.b3d",
  30. textures = {"moretrains_wagon_tank2.png"},
  31. seats = {},
  32. drives_on={default=true},
  33. max_speed=20,
  34. visual_size = {x=1, y=1},
  35. wagon_span=2.719,
  36. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  37. drops={"default:steelblock 2"},
  38. has_inventory = true,
  39. get_inventory_formspec = function(self, pname, invname)
  40. return "size[8,11]"..
  41. "list["..invname..";box;0,0;8,3;]"..
  42. "list[current_player;main;0,5;8,4;]"..
  43. "listring[]"
  44. end,
  45. inventory_list_sizes = {
  46. box=8*3,
  47. },
  48. }, S("Industrial tank wagon (blue)"), "moretrains_wagon_tank2_inv.png")
  49. advtrains.register_wagon("moretrains_wagon_wood", {
  50. mesh="moretrains_wagon_wood.b3d",
  51. textures = {"moretrains_wagon_wood.png"},
  52. seats = {},
  53. drives_on={default=true},
  54. max_speed=20,
  55. visual_size = {x=1, y=1},
  56. wagon_span=2.784,
  57. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  58. drops={"default:steelblock"},
  59. has_inventory = true,
  60. get_inventory_formspec = function(self, pname, invname)
  61. return "size[8,11]"..
  62. "list["..invname..";box;0,0;8,3;]"..
  63. "list[current_player;main;0,5;8,4;]"..
  64. "listring[]"
  65. end,
  66. inventory_list_sizes = {
  67. box=8*3,
  68. },
  69. }, S("Industrial wood wagon (empty)"), "moretrains_wagon_wood_inv.png")
  70. advtrains.register_wagon("moretrains_wagon_wood_loaded", {
  71. mesh="moretrains_wagon_wood_loaded.b3d",
  72. textures = {"moretrains_wagon_wood.png"},
  73. seats = {},
  74. drives_on={default=true},
  75. max_speed=20,
  76. visual_size = {x=1, y=1},
  77. wagon_span=2.784,
  78. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  79. drops={"default:steelblock"},
  80. has_inventory = true,
  81. get_inventory_formspec = function(self, pname, invname)
  82. return "size[8,11]"..
  83. "list["..invname..";box;0,0;8,3;]"..
  84. "list[current_player;main;0,5;8,4;]"..
  85. "listring[]"
  86. end,
  87. inventory_list_sizes = {
  88. box=8*3,
  89. },
  90. }, S("Industrial wood wagon (default tree)"), "moretrains_wagon_wood_loaded_inv.png")
  91. advtrains.register_wagon("moretrains_wagon_wood_acacia", {
  92. mesh="moretrains_wagon_wood_loaded.b3d",
  93. textures = {"moretrains_wagon_wood_acacia.png"},
  94. seats = {},
  95. drives_on={default=true},
  96. max_speed=20,
  97. visual_size = {x=1, y=1},
  98. wagon_span=2.784,
  99. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  100. drops={"default:steelblock"},
  101. has_inventory = true,
  102. get_inventory_formspec = function(self, pname, invname)
  103. return "size[8,11]"..
  104. "list["..invname..";box;0,0;8,3;]"..
  105. "list[current_player;main;0,5;8,4;]"..
  106. "listring[]"
  107. end,
  108. inventory_list_sizes = {
  109. box=8*3,
  110. },
  111. }, S("Industrial wood wagon (acacia)"), "moretrains_wagon_wood_acacia_inv.png")
  112. advtrains.register_wagon("moretrains_wagon_wood_jungle", {
  113. mesh="moretrains_wagon_wood_loaded.b3d",
  114. textures = {"moretrains_wagon_wood_jungle.png"},
  115. seats = {},
  116. drives_on={default=true},
  117. max_speed=20,
  118. visual_size = {x=1, y=1},
  119. wagon_span=2.784,
  120. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  121. drops={"default:steelblock"},
  122. has_inventory = true,
  123. get_inventory_formspec = function(self, pname, invname)
  124. return "size[8,11]"..
  125. "list["..invname..";box;0,0;8,3;]"..
  126. "list[current_player;main;0,5;8,4;]"..
  127. "listring[]"
  128. end,
  129. inventory_list_sizes = {
  130. box=8*3,
  131. },
  132. }, S("Industrial wood wagon (jungle)"), "moretrains_wagon_wood_jungle_inv.png")
  133. advtrains.register_wagon("moretrains_wagon_wood_pine", {
  134. mesh="moretrains_wagon_wood_loaded.b3d",
  135. textures = {"moretrains_wagon_wood_pine.png"},
  136. seats = {},
  137. drives_on={default=true},
  138. max_speed=20,
  139. visual_size = {x=1, y=1},
  140. wagon_span=2.784,
  141. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  142. drops={"default:steelblock"},
  143. has_inventory = true,
  144. get_inventory_formspec = function(self, pname, invname)
  145. return "size[8,11]"..
  146. "list["..invname..";box;0,0;8,3;]"..
  147. "list[current_player;main;0,5;8,4;]"..
  148. "listring[]"
  149. end,
  150. inventory_list_sizes = {
  151. box=8*3,
  152. },
  153. }, S("Industrial wood wagon (pine)"), "moretrains_wagon_wood_pine_inv.png")
  154. advtrains.register_wagon("moretrains_wagon_wood_aspen", {
  155. mesh="moretrains_wagon_wood_loaded.b3d",
  156. textures = {"moretrains_wagon_wood_aspen.png"},
  157. seats = {},
  158. drives_on={default=true},
  159. max_speed=20,
  160. visual_size = {x=1, y=1},
  161. wagon_span=2.784,
  162. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  163. drops={"default:steelblock"},
  164. has_inventory = true,
  165. get_inventory_formspec = function(self, pname, invname)
  166. return "size[8,11]"..
  167. "list["..invname..";box;0,0;8,3;]"..
  168. "list[current_player;main;0,5;8,4;]"..
  169. "listring[]"
  170. end,
  171. inventory_list_sizes = {
  172. box=8*3,
  173. },
  174. }, S("Industrial wood wagon (aspen)"), "moretrains_wagon_wood_aspen_inv.png")
  175. advtrains.register_wagon("moretrains_wagon_box", {
  176. mesh="moretrains_wagon_box.b3d",
  177. textures = {"moretrains_wagon_box.png"},
  178. seats = {},
  179. drives_on={default=true},
  180. max_speed=20,
  181. visual_size = {x=1, y=1},
  182. wagon_span=2.672,
  183. collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
  184. drops={"default:steelblock"},
  185. has_inventory = true,
  186. get_inventory_formspec = function(self, pname, invname)
  187. return "size[8,11]"..
  188. "list["..invname..";box;0,0;8,3;]"..
  189. "list[current_player;main;0,5;8,4;]"..
  190. "listring[]"
  191. end,
  192. inventory_list_sizes = {
  193. box=8*3,
  194. },
  195. }, S("Box wagon"), "moretrains_wagon_box_inv.png")
  196. minetest.register_craft({
  197. output = 'advtrains:moretrains_wagon_wood',
  198. recipe = {
  199. {'default:stick', 'default:stick', 'default:stick'},
  200. {'group:wood', 'default:chest', 'group:wood'},
  201. {'advtrains:wheel', '', 'advtrains:wheel'},
  202. },
  203. })
  204. minetest.register_craft({
  205. output = "advtrains:moretrains_wagon_wood_loaded",
  206. type = "shapeless",
  207. recipe = {"advtrains:moretrains_wagon_wood", "default:tree", "default:tree"},
  208. })
  209. minetest.register_craft({
  210. output = "advtrains:moretrains_wagon_wood_aspen",
  211. type = "shapeless",
  212. recipe = {"advtrains:moretrains_wagon_wood", "default:aspen_tree", "default:aspen_tree"},
  213. })
  214. minetest.register_craft({
  215. output = "advtrains:moretrains_wagon_wood_jungle",
  216. type = "shapeless",
  217. recipe = {"advtrains:moretrains_wagon_wood", "default:jungletree", "default:jungletree"},
  218. })
  219. minetest.register_craft({
  220. output = "advtrains:moretrains_wagon_wood_pine",
  221. type = "shapeless",
  222. recipe = {"advtrains:moretrains_wagon_wood", "default:pine_tree", "default:pine_tree"},
  223. })
  224. minetest.register_craft({
  225. output = "advtrains:moretrains_wagon_wood_acacia",
  226. type = "shapeless",
  227. recipe = {"advtrains:moretrains_wagon_wood", "default:acacia_tree", "default:acacia_tree"},
  228. })
  229. minetest.register_craftitem("moretrains_industrial:item_tank", {
  230. description = S("tank (for tankwagon)"),
  231. inventory_image = "moretrains_item_tank.png"
  232. })
  233. minetest.register_craft({
  234. output = "moretrains_industrial:item_tank",
  235. recipe = {
  236. {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
  237. {"default:steel_ingot", "bucket:bucket_empty", "default:steel_ingot"},
  238. {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
  239. },
  240. })
  241. minetest.register_craft({
  242. output = 'advtrains:moretrains_wagon_tank',
  243. recipe = {
  244. {'', '', ''},
  245. {'default:steel_ingot', 'moretrains_industrial:item_tank', 'default:steel_ingot'},
  246. {'advtrains:wheel', '', 'advtrains:wheel'},
  247. },
  248. })
  249. minetest.register_craft({
  250. output = 'advtrains:moretrains_wagon_tank2',
  251. recipe = {
  252. {'', 'dye:blue', ''},
  253. {'default:steel_ingot', 'moretrains_industrial:item_tank', 'default:steel_ingot'},
  254. {'advtrains:wheel', '', 'advtrains:wheel'},
  255. },
  256. })
  257. minetest.register_craft({
  258. output = 'advtrains:moretrains_wagon_box',
  259. recipe = {
  260. {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
  261. {'default:junglewood', 'default:chest', 'default:junglewood'},
  262. {'advtrains:wheel', '', 'advtrains:wheel'},
  263. },
  264. })