init.lua 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. lapis = lapis or {}
  2. dofile(minetest.get_modpath("lapis").."/columns.lua")
  3. ----------
  4. --Nodes
  5. ----------
  6. minetest.register_node( "lapis:lapis_block", {
  7. description = "Lapis With Calcite",
  8. tiles = {"lapis_block.png"},
  9. paramtype = "light",
  10. is_ground_content = true,
  11. groups = utility.dig_groups("stone"),
  12. drop = {
  13. max_items = 1,
  14. items = {
  15. {items = {'lapis:lapis_stone'}, rarity = 10},
  16. {items = {'lapis:lapis_cobble'}},
  17. },
  18. },
  19. sounds = default.node_sound_stone_defaults()
  20. })
  21. minetest.register_node( "lapis:lapis_brick", {
  22. description = "Lapis Brick",
  23. tiles = {
  24. "lapis_brick_top.png",
  25. "lapis_brick_top.png^[transformFXR90",
  26. "lapis_brick_side.png",
  27. "lapis_brick_side.png^[transformFX",
  28. "lapis_brick.png^[transformFX",
  29. "lapis_brick.png"
  30. },
  31. paramtype = "light",
  32. paramtype2 = "facedir",
  33. is_ground_content = false,
  34. groups = utility.dig_groups("brick"),
  35. sounds = default.node_sound_stone_defaults()
  36. })
  37. minetest.register_node( "lapis:lapis_cobble", {
  38. description = "Cobbled Lapis",
  39. tiles = {
  40. "lapis_cobble.png",
  41. "lapis_cobble.png^[transformFY",
  42. "lapis_cobble.png^[transformFX",
  43. "lapis_cobble.png",
  44. "lapis_cobble.png^[transformFX",
  45. "lapis_cobble.png"
  46. },
  47. paramtype = "light",
  48. is_ground_content = false,
  49. groups = utility.dig_groups("cobble"),
  50. sounds = default.node_sound_stone_defaults()
  51. })
  52. minetest.register_node( "lapis:lazurite_block", {
  53. description = "Lazurite",
  54. tiles = {"lapis_lazurite_block.png"},
  55. paramtype = "light",
  56. is_ground_content = true,
  57. groups = utility.dig_groups("block"),
  58. sounds = default.node_sound_stone_defaults()
  59. })
  60. minetest.register_node( "lapis:lazurite_brick", {
  61. description = "Lazurite Brick",
  62. tiles = {
  63. "lapis_lazurite_brick_top.png",
  64. "lapis_lazurite_brick_top.png^[transformFXR90",
  65. "lapis_lazurite_brick_side.png",
  66. "lapis_lazurite_brick_side.png^[transformFX",
  67. "lapis_lazurite_brick.png^[transformFX",
  68. "lapis_lazurite_brick.png"
  69. },
  70. paramtype = "light",
  71. paramtype2 = "facedir",
  72. is_ground_content = false,
  73. groups = utility.dig_groups("brick"),
  74. sounds = default.node_sound_stone_defaults()
  75. })
  76. minetest.register_node( "lapis:lapis_tile", {
  77. description = "Lapis Floor Tile",
  78. tiles = {"lapis_tile.png" },
  79. is_ground_content = false,
  80. paramtype = 'light',
  81. groups = utility.dig_groups("block"),
  82. sounds = default.node_sound_stone_defaults()
  83. })
  84. minetest.register_node( "lapis:pyrite_ore", {
  85. description = "Pyrite Ore",
  86. tiles = {"default_stone.png^lapis_mineral_pyrite.png" },
  87. paramtype = "light",
  88. is_ground_content = true,
  89. drop= 'lapis:pyrite_lump 2',
  90. silverpick_drop = true,
  91. groups = utility.dig_groups("mineral"),
  92. sounds = default.node_sound_stone_defaults() ,
  93. })
  94. minetest.register_node( "lapis:pyrite_block", {
  95. description = "Pyrite Block",
  96. tiles = {
  97. "lapis_pyrite_sacred.png",
  98. "lapis_pyrite_sacred.png",
  99. "lapis_pyrite_block.png"
  100. },
  101. paramtype = "light",
  102. paramtype2 = "facedir",
  103. is_ground_content = false,
  104. groups = utility.dig_groups("block"),
  105. sounds = default.node_sound_metal_defaults({
  106. footstep = {name = "default_hard_footstep", gain = 0.5},
  107. place = {name = "default_place_node_hard", gain = 1.0},
  108. }),
  109. })
  110. --Unused Rosace Stone from Darkage mod
  111. minetest.register_node("lapis:rosace", {
  112. description = "Rose Stone",
  113. tiles = {"lapis_rosace_front.png",
  114. "lapis_rosace_front.png",
  115. "lapis_rosace_side.png^[transformFX",
  116. "lapis_rosace_side.png^[transformFYR90",
  117. "lapis_rosace_side.png^[transformFY",
  118. "lapis_rosace_side.png"},
  119. paramtype2 = "facedir",
  120. is_ground_content = false,
  121. groups = utility.dig_groups("block"),
  122. sounds = default.node_sound_stone_defaults(),
  123. })
  124. -------------------
  125. --Stairs & Slabs
  126. -------------------
  127. stairs.register_stair_and_slab("lapis_block", "lapis:lapis_block",
  128. {cracky = 3},
  129. {"lapis_block.png"},
  130. "Lapis",
  131. default.node_sound_stone_defaults())
  132. stairs.register_stair_and_slab("lapis_brick", "lapis:lapis_brick",
  133. {cracky = 3},
  134. {"lapis_brick.png"},
  135. "Lapis Brick",
  136. default.node_sound_stone_defaults())
  137. stairs.register_stair_and_slab("lapis_cobble", "lapis:lapis_cobble",
  138. {cracky = 3},
  139. {"lapis_cobble.png"},
  140. "Lapis Cobble",
  141. default.node_sound_stone_defaults())
  142. stairs.register_stair_and_slab("lazurite", "lapis:lazurite_block",
  143. {cracky = 3},
  144. {"lapis_lazurite_block.png"},
  145. "Lazurite",
  146. default.node_sound_stone_defaults())
  147. stairs.register_stair_and_slab("lazurite_brick", "lapis:lazurite_brick",
  148. {cracky = 3},
  149. {"lapis_lazurite_brick.png"},
  150. "Lazurite Brick",
  151. default.node_sound_stone_defaults())
  152. stairs.register_stair_and_slab("pyrite_block", "lapis:pyrite_block",
  153. {cracky = 2},
  154. {"lapis_pyrite_sacred.png", "lapis_pyrite_sacred.png", "lapis_pyrite_block.png"},
  155. "Pyrite Block",
  156. default.node_sound_stone_defaults({
  157. footstep = {name = "default_hard_footstep", gain = 0.5},
  158. place = {name = "default_place_node_hard", gain = 1.0},
  159. }))
  160. ---------------
  161. -- Crafts Items
  162. ---------------
  163. minetest.register_craftitem("lapis:lapis_stone", {
  164. description = "Lapis Gemstone",
  165. inventory_image = "lapis_stone.png",
  166. })
  167. minetest.register_craftitem("lapis:pyrite_ingot", {
  168. description = "Pyrite Ingot",
  169. inventory_image = "lapis_pyrite_ingot.png",
  170. })
  171. minetest.register_craftitem("lapis:pyrite_lump", {
  172. description = "Fool's Gold",
  173. inventory_image = "lapis_pyrite_nugget.png",
  174. })
  175. ----------
  176. -- Crafts
  177. ----------
  178. minetest.register_craft({
  179. output = 'lapis:lazurite_block',
  180. recipe = {
  181. {'lapis:lapis_stone', 'lapis:lapis_stone', 'lapis:lapis_stone'},
  182. {'lapis:lapis_stone', 'lapis:pyrite_lump', 'lapis:lapis_stone'},
  183. {'lapis:lapis_stone', 'lapis:lapis_stone', 'lapis:lapis_stone'},
  184. }
  185. })
  186. minetest.register_craft({
  187. output = 'lapis:lapis_stone 9',
  188. recipe = {
  189. {'lapis:lapis_block'},
  190. }
  191. })
  192. minetest.register_craft({
  193. output = 'lapis:lapis_brick 4',
  194. recipe = {
  195. { 'lapis:lapis_block', 'lapis:lapis_block'},
  196. { 'lapis:lapis_block', 'lapis:lapis_block'},
  197. }
  198. })
  199. minetest.register_craft({
  200. output = 'lapis:lazurite_brick 4',
  201. recipe = {
  202. { '', 'lapis:lapis_brick', ''},
  203. { 'lapis:lapis_brick', 'lapis:pyrite_lump', 'lapis:lapis_brick'},
  204. { '', 'lapis:lapis_brick', ''},
  205. }
  206. })
  207. minetest.register_craft({
  208. output = 'lapis:lapis_tile',
  209. recipe = {
  210. { 'lapis:lazurite_brick'},
  211. }
  212. })
  213. minetest.register_craft({
  214. output = 'lapis:pyrite_block',
  215. recipe = {
  216. {'lapis:pyrite_ingot', 'lapis:pyrite_ingot', 'lapis:pyrite_ingot'},
  217. {'lapis:pyrite_ingot', 'lapis:pyrite_ingot', 'lapis:pyrite_ingot'},
  218. {'lapis:pyrite_ingot', 'lapis:pyrite_ingot', 'lapis:pyrite_ingot'},
  219. }
  220. })
  221. minetest.register_craft({
  222. output = 'lapis:pyrite_ingot 9',
  223. recipe = {
  224. {'lapis:pyrite_block'},
  225. }
  226. })
  227. minetest.register_craft({
  228. output = "lapis:rosace",
  229. recipe = {
  230. { "lapis:pyrite_ingot", "lapis:lapis_stone", "lapis:pyrite_ingot" },
  231. { "lapis:lapis_stone", "lapis:pyrite_ingot", "lapis:lapis_stone" },
  232. { "lapis:pyrite_ingot", "lapis:lapis_stone", "lapis:pyrite_ingot" },
  233. }
  234. })
  235. minetest.register_craft({
  236. output = 'dye:blue 2',
  237. recipe = {
  238. {'lapis:lapis_stone'},
  239. }
  240. })
  241. ------------
  242. -- Cooking
  243. ------------
  244. minetest.register_craft({
  245. type = 'cooking',
  246. output = 'lapis:lapis_block',
  247. recipe = 'lapis:lapis_cobble',
  248. })
  249. minetest.register_craft({
  250. type = "cooking",
  251. output = "lapis:pyrite_ingot",
  252. recipe = "lapis:pyrite_lump",
  253. })
  254. --------------------
  255. -- Ore Generation
  256. --------------------
  257. --lapis
  258. --Sheet ore registration
  259. oregen.register_ore({
  260. ore_type = "sheet",
  261. ore = "lapis:lapis_block",
  262. wherein = "default:stone",
  263. column_height_min = 1,
  264. column_height_max = 3,
  265. column_midpoint_factor = 0.5,
  266. y_min = 128,
  267. y_max = 164,
  268. noise_threshhold = 1.5,
  269. noise_params = {offset=0, scale=2, spread={x=20, y=20, z=10}, seed= 10 , octaves=2, persist=0.8}
  270. })
  271. -- pyrite
  272. oregen.register_ore({
  273. ore_type = "scatter",
  274. ore = "lapis:pyrite_ore",
  275. wherein = "default:stone",
  276. clust_scarcity = 15 * 15 * 15,
  277. clust_num_ores = 4,
  278. clust_size = 3,
  279. y_min = -50,
  280. y_max = 60,
  281. })
  282. oregen.register_ore({
  283. ore_type = "scatter",
  284. ore = "lapis:pyrite_ore",
  285. wherein = "default:stone",
  286. clust_scarcity = 13 * 13 * 13,
  287. clust_num_ores = 4,
  288. clust_size = 3,
  289. y_min = -150,
  290. y_max = -51,
  291. })
  292. ----------
  293. --Aliases
  294. ----------
  295. minetest.register_alias("lapis:lapis_paver", "lapis:lapis_cobble")
  296. minetest.register_alias("lapis:lazurite", "lapis:lapis_block")
  297. minetest.register_alias("lapis:pyrite_sacred","lapis:pyrite_block")
  298. minetest.register_alias("lapis:pyrite_coin","lapis:pyrite_ingot")
  299. minetest.register_alias("lapis:sacred_ore", "lapis:lazurite_block")