metals.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. -- Translation support
  2. local S = minetest.get_translator("basic_materials")
  3. -- items
  4. minetest.register_craftitem("basic_materials:steel_wire", {
  5. description = S("Spool of steel wire"),
  6. inventory_image = "basic_materials_steel_wire.png"
  7. })
  8. minetest.register_craftitem("basic_materials:copper_wire", {
  9. description = S("Spool of copper wire"),
  10. inventory_image = "basic_materials_copper_wire.png"
  11. })
  12. minetest.register_craftitem("basic_materials:silver_wire", {
  13. description = S("Spool of silver wire"),
  14. inventory_image = "basic_materials_silver_wire.png"
  15. })
  16. minetest.register_craftitem("basic_materials:gold_wire", {
  17. description = S("Spool of gold wire"),
  18. inventory_image = "basic_materials_gold_wire.png"
  19. })
  20. minetest.register_craftitem("basic_materials:steel_strip", {
  21. description = S("Steel Strip"),
  22. inventory_image = "basic_materials_steel_strip.png"
  23. })
  24. minetest.register_craftitem("basic_materials:copper_strip", {
  25. description = S("Copper Strip"),
  26. inventory_image = "basic_materials_copper_strip.png"
  27. })
  28. minetest.register_craftitem("basic_materials:steel_bar", {
  29. description = S("Steel Bar"),
  30. inventory_image = "basic_materials_steel_bar.png",
  31. })
  32. minetest.register_craftitem("basic_materials:chainlink_brass", {
  33. description = S("Chainlinks (brass)"),
  34. inventory_image = "basic_materials_chainlink_brass.png"
  35. })
  36. minetest.register_craftitem("basic_materials:chainlink_steel", {
  37. description = S("Chainlinks (steel)"),
  38. inventory_image = "basic_materials_chainlink_steel.png"
  39. })
  40. minetest.register_craftitem("basic_materials:brass_ingot", {
  41. description = S("Brass Ingot"),
  42. inventory_image = "basic_materials_brass_ingot.png",
  43. })
  44. minetest.register_craftitem("basic_materials:gear_steel", {
  45. description = S("Steel gear"),
  46. inventory_image = "basic_materials_gear_steel.png"
  47. })
  48. minetest.register_craftitem("basic_materials:padlock", {
  49. description = S("Padlock"),
  50. inventory_image = "basic_materials_padlock.png"
  51. })
  52. -- nodes
  53. local chains_sbox = {
  54. type = "fixed",
  55. fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 }
  56. }
  57. local topchains_sbox = {
  58. type = "fixed",
  59. fixed = {
  60. { -0.25, 0.35, -0.25, 0.25, 0.5, 0.25 },
  61. { -0.1, -0.5, -0.1, 0.1, 0.4, 0.1 }
  62. }
  63. }
  64. minetest.register_node("basic_materials:chain_steel", {
  65. description = S("Chain (steel, hanging)"),
  66. drawtype = "mesh",
  67. mesh = "basic_materials_chains.obj",
  68. tiles = {"basic_materials_chain_steel.png"},
  69. walkable = false,
  70. climbable = true,
  71. sunlight_propagates = true,
  72. paramtype = "light",
  73. inventory_image = "basic_materials_chain_steel_inv.png",
  74. groups = {cracky=3},
  75. selection_box = chains_sbox,
  76. })
  77. minetest.register_node("basic_materials:chain_brass", {
  78. description = S("Chain (brass, hanging)"),
  79. drawtype = "mesh",
  80. mesh = "basic_materials_chains.obj",
  81. tiles = {"basic_materials_chain_brass.png"},
  82. walkable = false,
  83. climbable = true,
  84. sunlight_propagates = true,
  85. paramtype = "light",
  86. inventory_image = "basic_materials_chain_brass_inv.png",
  87. groups = {cracky=3},
  88. selection_box = chains_sbox,
  89. })
  90. minetest.register_node("basic_materials:brass_block", {
  91. description = S("Brass Block"),
  92. tiles = { "basic_materials_brass_block.png" },
  93. is_ground_content = false,
  94. groups = {cracky=1, level=2},
  95. sounds = default.node_sound_metal_defaults()
  96. })
  97. -- crafts
  98. minetest.register_craft( {
  99. output = "basic_materials:copper_wire 2",
  100. type = "shapeless",
  101. recipe = {
  102. "default:copper_ingot",
  103. "basic_materials:empty_spool",
  104. "basic_materials:empty_spool",
  105. },
  106. })
  107. minetest.register_craft( {
  108. output = "basic_materials:silver_wire 2",
  109. type = "shapeless",
  110. recipe = {
  111. "moreores:silver_ingot",
  112. "basic_materials:empty_spool",
  113. "basic_materials:empty_spool",
  114. },
  115. })
  116. minetest.register_craft( {
  117. output = "basic_materials:gold_wire 2",
  118. type = "shapeless",
  119. recipe = {
  120. "default:gold_ingot",
  121. "basic_materials:empty_spool",
  122. "basic_materials:empty_spool",
  123. },
  124. })
  125. minetest.register_craft( {
  126. output = "basic_materials:steel_wire 2",
  127. type = "shapeless",
  128. recipe = {
  129. "default:steel_ingot",
  130. "basic_materials:empty_spool",
  131. "basic_materials:empty_spool",
  132. },
  133. })
  134. minetest.register_craft( {
  135. output = "basic_materials:steel_strip 12",
  136. recipe = {
  137. { "", "default:steel_ingot", "" },
  138. { "default:steel_ingot", "", "" },
  139. },
  140. })
  141. minetest.register_craft( {
  142. output = "basic_materials:copper_strip 12",
  143. recipe = {
  144. { "", "default:copper_ingot", "" },
  145. { "default:copper_ingot", "", "" },
  146. },
  147. })
  148. minetest.register_craft( {
  149. output = "basic_materials:steel_bar 6",
  150. recipe = {
  151. { "", "", "default:steel_ingot" },
  152. { "", "default:steel_ingot", "" },
  153. { "default:steel_ingot", "", "" },
  154. },
  155. })
  156. minetest.register_craft( {
  157. output = "basic_materials:padlock 2",
  158. recipe = {
  159. { "basic_materials:steel_bar" },
  160. { "default:steel_ingot" },
  161. { "default:steel_ingot" },
  162. },
  163. })
  164. minetest.register_craft({
  165. output = "basic_materials:chainlink_steel 12",
  166. recipe = {
  167. {"", "default:steel_ingot", "default:steel_ingot"},
  168. { "default:steel_ingot", "", "default:steel_ingot" },
  169. { "default:steel_ingot", "default:steel_ingot", "" },
  170. },
  171. })
  172. minetest.register_craft({
  173. output = "basic_materials:chainlink_brass 12",
  174. recipe = {
  175. {"", "basic_materials:brass_ingot", "basic_materials:brass_ingot"},
  176. { "basic_materials:brass_ingot", "", "basic_materials:brass_ingot" },
  177. { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "" },
  178. },
  179. })
  180. minetest.register_craft({
  181. output = 'basic_materials:chain_steel 2',
  182. recipe = {
  183. {"basic_materials:chainlink_steel"},
  184. {"basic_materials:chainlink_steel"},
  185. {"basic_materials:chainlink_steel"}
  186. }
  187. })
  188. minetest.register_craft({
  189. output = 'basic_materials:chain_brass 2',
  190. recipe = {
  191. {"basic_materials:chainlink_brass"},
  192. {"basic_materials:chainlink_brass"},
  193. {"basic_materials:chainlink_brass"}
  194. }
  195. })
  196. minetest.register_craft( {
  197. output = "basic_materials:gear_steel 6",
  198. recipe = {
  199. { "", "default:steel_ingot", "" },
  200. { "default:steel_ingot","basic_materials:chainlink_steel", "default:steel_ingot" },
  201. { "", "default:steel_ingot", "" }
  202. },
  203. })
  204. minetest.register_craft( {
  205. type = "shapeless",
  206. output = "basic_materials:brass_ingot 3",
  207. recipe = {
  208. "default:copper_ingot",
  209. "default:copper_ingot",
  210. "moreores:silver_ingot",
  211. },
  212. })
  213. minetest.register_craft( {
  214. type = "shapeless",
  215. output = "basic_materials:brass_ingot 9",
  216. recipe = { "basic_materials:brass_block" },
  217. })
  218. minetest.register_craft( {
  219. output = "basic_materials:brass_block",
  220. recipe = {
  221. { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
  222. { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
  223. { "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
  224. },
  225. })
  226. -- aliases
  227. minetest.register_alias("homedecor:copper_wire", "basic_materials:copper_wire")
  228. minetest.register_alias("technic:fine_copper_wire", "basic_materials:copper_wire")
  229. minetest.register_alias("technic:fine_silver_wire", "basic_materials:silver_wire")
  230. minetest.register_alias("technic:fine_gold_wire", "basic_materials:gold_wire")
  231. minetest.register_alias("homedecor:steel_wire", "basic_materials:steel_wire")
  232. minetest.register_alias("homedecor:brass_ingot", "basic_materials:brass_ingot")
  233. minetest.register_alias("technic:brass_ingot", "basic_materials:brass_ingot")
  234. minetest.register_alias("technic:brass_block", "basic_materials:brass_block")
  235. minetest.register_alias("homedecor:copper_strip", "basic_materials:copper_strip")
  236. minetest.register_alias("homedecor:steel_strip", "basic_materials:steel_strip")
  237. minetest.register_alias_force("glooptest:chainlink", "basic_materials:chainlink_steel")
  238. minetest.register_alias_force("homedecor:chainlink_steel", "basic_materials:chainlink_steel")
  239. minetest.register_alias("homedecor:chainlink_brass", "basic_materials:chainlink_brass")
  240. minetest.register_alias("chains:chain", "basic_materials:chain_steel")
  241. minetest.register_alias("chains:chain_brass", "basic_materials:chain_brass")
  242. minetest.register_alias("pipeworks:gear", "basic_materials:gear_steel")
  243. minetest.register_alias("technic:rebar", "basic_materials:steel_bar")