metals.lua 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. -- returns true if the item needs to be registered
  2. local function check_aliases(item, aliases)
  3. local missing = true
  4. for _,a in ipairs(aliases) do
  5. if minetest.registered_items[a] then
  6. missing = false
  7. minetest.register_alias(item, a)
  8. end
  9. end
  10. return missing
  11. end
  12. -- zinc
  13. if check_aliases("potions:zinc_ingot", {"default:zinc_ingot"}) then
  14. minetest.register_craftitem("potions:zinc_ingot", {
  15. description = "Zinc Ingot",
  16. inventory_image = "default_steel_ingot.png^[colorize:blue:30",
  17. })
  18. end
  19. if check_aliases("potions:sphalerite_lump", {"default:zinc_lump"}) then
  20. minetest.register_craftitem("potions:sphalerite_lump", {
  21. description = "Sphalerite Lump",
  22. inventory_image = "potions_sphalerite_lump.png",
  23. })
  24. end
  25. if check_aliases("potions:sphalerite_ore", {"default:zinc_ore"}) then
  26. minetest.register_node("potions:sphalerite_ore", {
  27. description = "Sphalerite Ore",
  28. tiles = {"default_stone.png^potions_sphalerite_ore.png"},
  29. drop = "potions:sphalerite_lump",
  30. groups = {cracky = 3},
  31. sounds = default.node_sound_stone_defaults(),
  32. })
  33. minetest.register_craft({
  34. output = "potions:zinc_ingot",
  35. type = "cooking",
  36. recipe = "potions:sphalerite_lump",
  37. })
  38. end
  39. -- brass
  40. if check_aliases("potions:brass_ingot", {"default:brass_ingot"}) then
  41. minetest.register_craftitem("potions:brass_ingot", {
  42. description = "Brass Ingot",
  43. inventory_image = "default_gold_ingot.png^[colorize:white:50",
  44. })
  45. minetest.register_craft({
  46. output = "potions:brass_ingot 3",
  47. type = "shapeless",
  48. recipe = {
  49. "potions:zinc_ingot",
  50. "default:copper_ingot",
  51. "default:copper_ingot",
  52. },
  53. })
  54. end
  55. -- lead
  56. if check_aliases("potions:lead_ingot", {"default:lead_ingot"}) then
  57. minetest.register_craftitem("potions:lead_ingot", {
  58. description = "Lead Ingot",
  59. inventory_image = "default_steel_ingot.png^[colorize:black:30",
  60. })
  61. end
  62. if check_aliases("potions:lead_lump", {"default:lead_lump"}) then
  63. minetest.register_craftitem("potions:lead_lump", {
  64. description = "lead Lump",
  65. inventory_image = "default_iron_lump^[colorize:black:30",
  66. })
  67. end
  68. if check_aliases("potions:lead_block", {"default:leadblock"}) then
  69. minetest.register_craftitem("potions:lead_block", {
  70. description = "Lead Block",
  71. inventory_image = "default_steel_block.png^[colorize:black:30",
  72. })
  73. minetest.register_craft({
  74. output = "potions:lead_block 1",
  75. type = "shapeless",
  76. recipe = {
  77. "potions:lead_ingot", "potions:lead_ingot", "potions:lead_ingot",
  78. "potions:lead_ingot", "potions:lead_ingot", "potions:lead_ingot",
  79. "potions:lead_ingot", "potions:lead_ingot", "potions:lead_ingot",
  80. },
  81. })
  82. end
  83. if check_aliases("potions:galena", {"default:lead_ore"}) then
  84. minetest.register_node("potions:galena", {
  85. description = "Lead Ore",
  86. tiles = {"default_stone.png^potions_galena_ore.png"},
  87. drop = "potions:galena_lump",
  88. -- TODO: drop silver sometimes
  89. groups = {cracky = 3},
  90. sounds = default.node_sound_stone_defaults(),
  91. })
  92. minetest.register_craft({
  93. output = "potions:lead_ingot",
  94. type = "cooking",
  95. recipe = "potions:galena_lump",
  96. })
  97. end
  98. -- mercury
  99. minetest.register_craftitem("potions:mercury_vial", {
  100. description = "Quicksilver Vial",
  101. inventory_image = "potions_mercury_vial.png",
  102. groups = {vessel = 1},
  103. })
  104. minetest.register_craftitem("potions:mercury_flask", {
  105. description = "Quicksilver Flask",
  106. inventory_image = "potions_mercury_flask.png",
  107. groups = {vessel = 1},
  108. })
  109. minetest.register_craftitem("potions:mercury_bottle", {
  110. description = "Quicksilver Bottle",
  111. inventory_image = "potions_mercury_bottle.png",
  112. groups = {vessel = 1},
  113. })
  114. minetest.register_craft({
  115. output = "potions:mercury_flask",
  116. type = "shapeless",
  117. recipe = {
  118. "potions:mercury_vial", "potions:mercury_vial", "potions:mercury_vial",
  119. "potions:mercury_vial", "potions:mercury_vial", "potions:mercury_vial",
  120. "potions:mercury_vial", "potions:mercury_vial", "potions:mercury_vial",
  121. },
  122. })
  123. minetest.register_craft({
  124. output = "potions:mercury_bottle",
  125. type = "shapeless",
  126. recipe = {
  127. "potions:mercury_flask", "potions:mercury_flask", "potions:mercury_flask",
  128. "potions:mercury_flask", "potions:mercury_flask", "potions:mercury_flask",
  129. "potions:mercury_flask", "potions:mercury_flask", "potions:mercury_flask",
  130. },
  131. })
  132. minetest.register_craft({
  133. output = "potions:mercury_flask 9",
  134. type = "shapeless",
  135. recipe = {"potions:mercury_bottle"},
  136. })
  137. minetest.register_craft({
  138. output = "potions:mercury_vial 9",
  139. type = "shapeless",
  140. recipe = {"potions:mercury_flask"},
  141. })
  142. -- mercury ore
  143. minetest.register_craftitem("potions:cinnabar_lump", {
  144. description = "Cinnabar",
  145. inventory_image = "potions_cinnabar_lump.png",
  146. })
  147. minetest.register_node("potions:cinnabar_ore", {
  148. description = "Cinnabar Ore",
  149. tiles = {"default_sandstone.png^potions_cinnabar_ore.png"},
  150. drop = "potions:cinnabar_lump",
  151. groups = {cracky = 3},
  152. sounds = default.node_sound_stone_defaults(),
  153. })
  154. -- mercury can't be cooked, it has to be distilled
  155. minetest.register_ore({
  156. ore_type = "blob",
  157. ore = "potions:sphalerite_ore",
  158. wherein = {"default:desert_sandstone"},
  159. clust_scarcity = 16 * 16 * 16,
  160. clust_size = 5,
  161. y_max = 82,
  162. y_min = 25,
  163. noise_threshold = -0.0,
  164. noise_params = {
  165. offset = 0.5,
  166. scale = 0.2,
  167. spread = {x = 5, y = 5, z = 5},
  168. seed = 5776,
  169. octaves = 1,
  170. persist = 0.0
  171. },
  172. biomes = {"desert"},
  173. })
  174. minetest.register_ore({
  175. ore_type = "blob",
  176. ore = "potions:cinnabar_ore",
  177. wherein = {"default:sandstone"},
  178. clust_scarcity = 16 * 16 * 16,
  179. clust_size = 5,
  180. y_max = 82,
  181. y_min = 30,
  182. noise_threshold = -0.0,
  183. noise_params = {
  184. offset = 0.5,
  185. scale = 0.2,
  186. spread = {x = 5, y = 5, z = 5},
  187. seed = 2467,
  188. octaves = 1,
  189. persist = 0.0
  190. },
  191. biomes = {"sandstone_desert"},
  192. })
  193. minetest.register_ore({
  194. ore_type = "scatter",
  195. ore = "potions:galena",
  196. wherein = {"default:silver_sandstone"},
  197. clust_scarcity = 16 * 16 * 16,
  198. clust_num_ores = 12,
  199. clust_size = 5,
  200. y_max = 62,
  201. y_min = 15,
  202. noise_threshold = 0.0,
  203. noise_params = {
  204. offset = 0.5,
  205. scale = 0.2,
  206. spread = {x = 5, y = 5, z = 5},
  207. seed = 27636,
  208. octaves = 1,
  209. persist = 0.0
  210. },
  211. biomes = {"cold_desert"},
  212. })