init.lua 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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. place_param2 = 10,
  94. })
  95. minetest.register_node( "lapis:pyrite_block", {
  96. description = "Pyrite Block",
  97. tiles = {
  98. "lapis_pyrite_sacred.png",
  99. "lapis_pyrite_sacred.png",
  100. "lapis_pyrite_block.png"
  101. },
  102. paramtype = "light",
  103. paramtype2 = "facedir",
  104. is_ground_content = false,
  105. groups = utility.dig_groups("block"),
  106. sounds = default.node_sound_metal_defaults({
  107. footstep = {name = "default_hard_footstep", gain = 0.5},
  108. place = {name = "default_place_node_hard", gain = 1.0},
  109. }),
  110. })
  111. --Unused Rosace Stone from Darkage mod
  112. minetest.register_node("lapis:rosace", {
  113. description = "Rose Stone",
  114. tiles = {"lapis_rosace_front.png",
  115. "lapis_rosace_front.png",
  116. "lapis_rosace_side.png^[transformFX",
  117. "lapis_rosace_side.png^[transformFYR90",
  118. "lapis_rosace_side.png^[transformFY",
  119. "lapis_rosace_side.png"},
  120. paramtype2 = "facedir",
  121. is_ground_content = false,
  122. groups = utility.dig_groups("block"),
  123. sounds = default.node_sound_stone_defaults(),
  124. })
  125. -------------------
  126. --Stairs & Slabs
  127. -------------------
  128. stairs.register_stair_and_slab("lapis_block", "lapis:lapis_block",
  129. {cracky = 3},
  130. {"lapis_block.png"},
  131. "Lapis",
  132. default.node_sound_stone_defaults())
  133. stairs.register_stair_and_slab("lapis_brick", "lapis:lapis_brick",
  134. {cracky = 3},
  135. {"lapis_brick.png"},
  136. "Lapis Brick",
  137. default.node_sound_stone_defaults())
  138. stairs.register_stair_and_slab("lapis_cobble", "lapis:lapis_cobble",
  139. {cracky = 3},
  140. {"lapis_cobble.png"},
  141. "Lapis Cobble",
  142. default.node_sound_stone_defaults())
  143. stairs.register_stair_and_slab("lazurite", "lapis:lazurite_block",
  144. {cracky = 3},
  145. {"lapis_lazurite_block.png"},
  146. "Lazurite",
  147. default.node_sound_stone_defaults())
  148. stairs.register_stair_and_slab("lazurite_brick", "lapis:lazurite_brick",
  149. {cracky = 3},
  150. {"lapis_lazurite_brick.png"},
  151. "Lazurite Brick",
  152. default.node_sound_stone_defaults())
  153. stairs.register_stair_and_slab("pyrite_block", "lapis:pyrite_block",
  154. {cracky = 2},
  155. {"lapis_pyrite_sacred.png", "lapis_pyrite_sacred.png", "lapis_pyrite_block.png"},
  156. "Pyrite Block",
  157. default.node_sound_stone_defaults({
  158. footstep = {name = "default_hard_footstep", gain = 0.5},
  159. place = {name = "default_place_node_hard", gain = 1.0},
  160. }))
  161. ---------------
  162. -- Crafts Items
  163. ---------------
  164. minetest.register_craftitem("lapis:lapis_stone", {
  165. description = "Lapis Gemstone",
  166. inventory_image = "lapis_stone.png",
  167. })
  168. minetest.register_craftitem("lapis:pyrite_ingot", {
  169. description = "Pyrite Ingot",
  170. inventory_image = "lapis_pyrite_ingot.png",
  171. })
  172. minetest.register_craftitem("lapis:pyrite_lump", {
  173. description = "Fool's Gold",
  174. inventory_image = "lapis_pyrite_nugget.png",
  175. })
  176. ----------
  177. -- Crafts
  178. ----------
  179. minetest.register_craft({
  180. output = 'lapis:lazurite_block',
  181. recipe = {
  182. {'lapis:lapis_stone', 'lapis:lapis_stone', 'lapis:lapis_stone'},
  183. {'lapis:lapis_stone', 'lapis:pyrite_lump', 'lapis:lapis_stone'},
  184. {'lapis:lapis_stone', 'lapis:lapis_stone', 'lapis:lapis_stone'},
  185. }
  186. })
  187. minetest.register_craft({
  188. output = 'lapis:lapis_stone 9',
  189. recipe = {
  190. {'lapis:lapis_block'},
  191. }
  192. })
  193. minetest.register_craft({
  194. output = 'lapis:lapis_brick 4',
  195. recipe = {
  196. { 'lapis:lapis_block', 'lapis:lapis_block'},
  197. { 'lapis:lapis_block', 'lapis:lapis_block'},
  198. }
  199. })
  200. minetest.register_craft({
  201. output = 'lapis:lazurite_brick 4',
  202. recipe = {
  203. { '', 'lapis:lapis_brick', ''},
  204. { 'lapis:lapis_brick', 'lapis:pyrite_lump', 'lapis:lapis_brick'},
  205. { '', 'lapis:lapis_brick', ''},
  206. }
  207. })
  208. minetest.register_craft({
  209. output = 'lapis:lapis_tile',
  210. recipe = {
  211. { 'lapis:lazurite_brick'},
  212. }
  213. })
  214. minetest.register_craft({
  215. output = 'lapis:pyrite_block',
  216. recipe = {
  217. {'lapis:pyrite_ingot', 'lapis:pyrite_ingot', 'lapis:pyrite_ingot'},
  218. {'lapis:pyrite_ingot', 'lapis:pyrite_ingot', 'lapis:pyrite_ingot'},
  219. {'lapis:pyrite_ingot', 'lapis:pyrite_ingot', 'lapis:pyrite_ingot'},
  220. }
  221. })
  222. minetest.register_craft({
  223. output = 'lapis:pyrite_ingot 9',
  224. recipe = {
  225. {'lapis:pyrite_block'},
  226. }
  227. })
  228. minetest.register_craft({
  229. output = "lapis:rosace",
  230. recipe = {
  231. { "lapis:pyrite_ingot", "lapis:lapis_stone", "lapis:pyrite_ingot" },
  232. { "lapis:lapis_stone", "lapis:pyrite_ingot", "lapis:lapis_stone" },
  233. { "lapis:pyrite_ingot", "lapis:lapis_stone", "lapis:pyrite_ingot" },
  234. }
  235. })
  236. minetest.register_craft({
  237. output = 'dye:blue 2',
  238. recipe = {
  239. {'lapis:lapis_stone'},
  240. }
  241. })
  242. ------------
  243. -- Cooking
  244. ------------
  245. minetest.register_craft({
  246. type = 'cooking',
  247. output = 'lapis:lapis_block',
  248. recipe = 'lapis:lapis_cobble',
  249. })
  250. minetest.register_craft({
  251. type = "cooking",
  252. output = "lapis:pyrite_ingot",
  253. recipe = "lapis:pyrite_lump",
  254. })
  255. --------------------
  256. -- Ore Generation
  257. --------------------
  258. --lapis
  259. --Sheet ore registration
  260. oregen.register_ore({
  261. ore_type = "sheet",
  262. ore = "lapis:lapis_block",
  263. wherein = "default:stone",
  264. column_height_min = 1,
  265. column_height_max = 3,
  266. column_midpoint_factor = 0.5,
  267. y_min = 128,
  268. y_max = 164,
  269. noise_threshhold = 1.5,
  270. noise_params = {offset=0, scale=2, spread={x=20, y=20, z=10}, seed= 10 , octaves=2, persist=0.8}
  271. })
  272. -- pyrite
  273. oregen.register_ore({
  274. ore_type = "scatter",
  275. ore = "lapis:pyrite_ore",
  276. wherein = "default:stone",
  277. clust_scarcity = 15 * 15 * 15,
  278. clust_num_ores = 4,
  279. clust_size = 3,
  280. y_min = -50,
  281. y_max = 60,
  282. })
  283. oregen.register_ore({
  284. ore_type = "scatter",
  285. ore = "lapis:pyrite_ore",
  286. wherein = "default:stone",
  287. clust_scarcity = 13 * 13 * 13,
  288. clust_num_ores = 4,
  289. clust_size = 3,
  290. y_min = -150,
  291. y_max = -51,
  292. })
  293. ----------
  294. --Aliases
  295. ----------
  296. minetest.register_alias("lapis:lapis_paver", "lapis:lapis_cobble")
  297. minetest.register_alias("lapis:lazurite", "lapis:lapis_block")
  298. minetest.register_alias("lapis:pyrite_sacred","lapis:pyrite_block")
  299. minetest.register_alias("lapis:pyrite_coin","lapis:pyrite_ingot")
  300. minetest.register_alias("lapis:sacred_ore", "lapis:lazurite_block")