init.lua 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  1. if not minetest.global_exists("rackstone") then rackstone = {} end
  2. rackstone.modpath = minetest.get_modpath("rackstone")
  3. -- group:rackstone is being used to check if a node should be considered naturally occuring for ambiance purposes.
  4. -- Localize for performance.
  5. local math_random = math.random
  6. -- Base light-level for all nether nodes.
  7. -- Otherwise the nether would be black.
  8. rackstone.light_source = 2
  9. rackstone.rackstone_sounds =
  10. function()
  11. local table = {
  12. dig = {name="rackstone_dugstonemetal", gain=1.0},
  13. dug = {name="rackstone_digstonemetal", gain=1.0},
  14. --place = {name="rackstone_placestonemetal", gain=1.0},
  15. }
  16. return default.node_sound_stone_defaults(table)
  17. end
  18. rackstone.cobble_sounds =
  19. function()
  20. local table = {
  21. footstep = {name="default_gravel_footstep", gain=0.5},
  22. }
  23. return default.node_sound_stone_defaults(table)
  24. end
  25. rackstone.destabilize_dauthsand =
  26. function(pos)
  27. local minp = {x=pos.x-1, y=pos.y, z=pos.z-1}
  28. local maxp = {x=pos.x+1, y=pos.y, z=pos.z+1}
  29. local nodes = minetest.find_nodes_in_area(minp, maxp, "rackstone:dauthsand_stable")
  30. for k, v in ipairs(nodes) do
  31. minetest.swap_node(v, {name="rackstone:dauthsand"})
  32. minetest.check_for_falling(v)
  33. end
  34. end
  35. minetest.register_node("rackstone:rackstone", {
  36. description = "Rackstone",
  37. tiles = {"rackstone_rackstone.png"},
  38. groups = utility.dig_groups("stone", {rackstone=1, stabilize_dauthsand=1, netherack=1}),
  39. sounds = default.node_sound_stone_defaults(),
  40. after_destruct = rackstone.destabilize_dauthsand,
  41. movement_speed_multiplier = default.ROAD_SPEED_NETHER,
  42. --light_source = rackstone.light_source,
  43. -- Common stone does not count toward tool's dig count.
  44. _toolranks = {
  45. ignore = true,
  46. },
  47. drop = "rackstone:cobble",
  48. _is_bulk_mapgen_stone = true,
  49. })
  50. minetest.register_node("rackstone:cobble", {
  51. description = "Rackstone Cobble",
  52. tiles = {"rackstone_rackstone_cobble.png"},
  53. groups = utility.dig_groups("cobble", {rackstone=1, stabilize_dauthsand=1, netherack=1}),
  54. sounds = rackstone.cobble_sounds(),
  55. after_destruct = rackstone.destabilize_dauthsand,
  56. movement_speed_multiplier = default.ROAD_SPEED_NETHER,
  57. -- Common stone does not count toward tool's dig count.
  58. _toolranks = {
  59. ignore = true,
  60. },
  61. _no_auto_pop = true,
  62. _is_bulk_mapgen_stone = true,
  63. })
  64. minetest.register_node("rackstone:rackstone_brick2", {
  65. description = "Rackstone Brick",
  66. paramtype2 = "facedir",
  67. place_param2 = 0,
  68. tiles = {"rackstone_rackstone_brick.png"},
  69. groups = utility.dig_groups("brick", {rackstone=1, brick=1}),
  70. sounds = default.node_sound_stone_defaults(),
  71. })
  72. minetest.register_node("rackstone:rackstone_block", {
  73. description = "Rackstone Block",
  74. paramtype2 = "facedir",
  75. place_param2 = 0,
  76. tiles = {"rackstone_rackstone_block.png"},
  77. groups = utility.dig_groups("block", {rackstone=1}),
  78. sounds = default.node_sound_stone_defaults(),
  79. })
  80. local after_redrack_remove = function(pos)
  81. -- Remove netherflame above.
  82. local flamepos = {x=pos.x, y=pos.y+1, z=pos.z}
  83. if minetest.get_node(flamepos).name == "fire:nether_flame" then
  84. minetest.remove_node(flamepos)
  85. end
  86. -- Tricks!
  87. if math_random(1, 500) == 1 then
  88. local which = math_random(1, 4)
  89. ambiance.sound_play("tnt_gunpowder_burning", pos, 2, 20)
  90. if which == 1 then
  91. minetest.add_node(pos, {name='rackstone:evilrack'})
  92. core.check_for_falling(pos)
  93. elseif which == 2 then
  94. minetest.add_node(pos, {name="fire:nether_flame"})
  95. elseif which == 3 then
  96. minetest.add_node(pos, {name="default:lava_source"})
  97. else
  98. --ambiance.sound_play("tnt_gunpowder_burning", pos, 2, 20)
  99. -- Delay after TNT gunpowder burning sound to give warning.
  100. minetest.after(1.5, function()
  101. local def = {
  102. radius = 3,
  103. damage_radius = 2,
  104. ignore_protection = false,
  105. disable_drops = true,
  106. ignore_on_blast = false,
  107. }
  108. tnt.boom(pos, def)
  109. end)
  110. end
  111. end
  112. end
  113. rackstone.after_redrack_remove = after_redrack_remove
  114. local on_redrack_place = function(pos)
  115. if math_random(1, 6) == 1 then
  116. local posabove = {x=pos.x, y=pos.y+1, z=pos.z}
  117. local light = minetest.get_node_light(posabove)
  118. if light then
  119. if light >= 15 then
  120. -- Copy position table, just in case.
  121. local npos = {x=pos.x, y=pos.y, z=pos.z}
  122. ambiance.sound_play("default_gravel_footstep", npos, 1, 20)
  123. minetest.after(math_random(1, 6), function()
  124. minetest.remove_node(npos)
  125. local def = {
  126. radius = 2,
  127. damage_radius = 2,
  128. ignore_protection = false,
  129. disable_drops = true,
  130. ignore_on_blast = false,
  131. }
  132. tnt.boom(npos, def)
  133. end)
  134. end
  135. end
  136. end
  137. end
  138. rackstone.on_redrack_place = on_redrack_place
  139. minetest.register_node("rackstone:redrack", {
  140. description = "Netherack",
  141. tiles = {"rackstone_redrack.png"},
  142. groups = utility.dig_groups("netherack", {rackstone=1, stabilize_dauthsand=1, netherack=1}),
  143. sounds = rackstone.rackstone_sounds(),
  144. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  145. drop = {
  146. max_items = 1,
  147. items = {
  148. {
  149. rarity = 2,
  150. tool_groups = {
  151. "gem_tool",
  152. },
  153. items = {},
  154. },
  155. {
  156. rarity = 1,
  157. items = {"rackstone:redrack_cobble"},
  158. }
  159. },
  160. },
  161. _is_bulk_mapgen_stone = true,
  162. -- Common stone does not count toward tool's dig count.
  163. _toolranks = {
  164. ignore = true,
  165. },
  166. light_source = rackstone.light_source,
  167. after_destruct = function(...)
  168. after_redrack_remove(...)
  169. rackstone.destabilize_dauthsand(...)
  170. end,
  171. on_construct = function(...)
  172. on_redrack_place(...)
  173. end,
  174. on_player_walk_over = function(pos, player)
  175. if math_random(1, 2000) == 1 then
  176. minetest.after(math_random(1, 4), function()
  177. if not minetest.test_protection(pos, "") then
  178. tnt.boom(pos, {
  179. radius = 2,
  180. ignore_protection = false,
  181. ignore_on_blast = false,
  182. damage_radius = 3,
  183. disable_drops = true,
  184. })
  185. end
  186. end)
  187. end
  188. end,
  189. })
  190. minetest.register_node("rackstone:redrack_cobble", {
  191. description = "Cobbled Netherack",
  192. tiles = {"rackstone_redrack_cobble.png"},
  193. groups = utility.dig_groups("netherack", {rackstone=1, stabilize_dauthsand=1, netherack=1}),
  194. sounds = rackstone.rackstone_sounds(),
  195. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  196. -- Common stone does not count toward tool's dig count.
  197. _toolranks = {
  198. ignore = true,
  199. },
  200. _no_auto_pop = true,
  201. _is_bulk_mapgen_stone = true,
  202. after_destruct = function(...)
  203. rackstone.destabilize_dauthsand(...)
  204. end,
  205. on_construct = function(...)
  206. on_redrack_place(...)
  207. end,
  208. on_player_walk_over = function(pos, player)
  209. if math_random(1, 10000) == 1 then
  210. minetest.after(math_random(1, 4), function()
  211. if not minetest.test_protection(pos, "") then
  212. tnt.boom(pos, {
  213. radius = 2,
  214. ignore_protection = false,
  215. ignore_on_blast = false,
  216. damage_radius = 2,
  217. disable_drops = true,
  218. })
  219. end
  220. end)
  221. end
  222. end,
  223. })
  224. minetest.register_node("rackstone:nether_grit", {
  225. description = "Nether Grit",
  226. tiles = {{
  227. name = "rackstone_redrack2_animated.png",
  228. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 5.0},
  229. }},
  230. --tiles = {"rackstone_redrack2.png"},
  231. groups = utility.dig_groups("racksand", {falling_node=1, disable_jump=1}),
  232. sounds = rackstone.rackstone_sounds(),
  233. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  234. liquid_viscosity = 8,
  235. liquidtype = "source",
  236. liquid_alternative_flowing = "rackstone:nether_grit",
  237. liquid_alternative_source = "rackstone:nether_grit",
  238. liquid_renewable = false,
  239. liquid_range = 0,
  240. light_source = rackstone.light_source,
  241. walkable = false,
  242. -- This was an attempt to make the pathfinder avoid these nodes, but by making
  243. -- the node walkable, the pathfinder just generates paths that go *over* them,
  244. -- anyway.
  245. --walkable = true,
  246. --collision_box = {type="fixed", fixed={0,0,0, 0,0,0}},
  247. drawtype = "glasslike",
  248. paramtype = "light",
  249. post_effect_color = {a = 200, r = 30, g = 0, b = 0},
  250. damage_per_second = 1*500,
  251. _damage_per_second_type = "poison",
  252. _death_message = function() return "Nether tar ate a new hole in <player>." end,
  253. drop = {
  254. max_items = 1,
  255. items = {
  256. {items = {'default:flint'}, rarity = 16},
  257. {items = {'rackstone:nether_grit'}}
  258. }
  259. },
  260. _is_bulk_mapgen_stone = true,
  261. })
  262. minetest.register_node("rackstone:void", {
  263. description = "Nether Void Gap (You Hacker!)",
  264. tiles = {"rackstone_redrack.png"},
  265. groups = utility.dig_groups("cobble"),
  266. sounds = rackstone.rackstone_sounds(),
  267. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  268. walkable = false,
  269. drawtype = "glasslike",
  270. paramtype = "light",
  271. post_effect_color = {a = 200, r = 30, g = 0, b = 0},
  272. damage_per_second = 1*500,
  273. _damage_per_second_type = "crush",
  274. _death_message = "<player> found a void pocket.",
  275. drop = "",
  276. _is_bulk_mapgen_stone = true,
  277. light_source = rackstone.light_source,
  278. })
  279. minetest.register_node("rackstone:redrack_with_iron", {
  280. description = "Netherack With Iron",
  281. tiles = {
  282. "rackstone_redrack.png",
  283. "rackstone_redrack.png",
  284. "rackstone_redrack.png^default_mineral_iron3.png",
  285. "rackstone_redrack.png^default_mineral_iron3.png",
  286. "rackstone_redrack.png^default_mineral_iron3.png",
  287. "rackstone_redrack.png^default_mineral_iron3.png",
  288. },
  289. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1, ore = 1}),
  290. sounds = rackstone.rackstone_sounds(),
  291. drop = "default:iron_lump",
  292. _tnt_drop = "default:iron_lump 2",
  293. silverpick_drop = true,
  294. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  295. place_param2 = 10,
  296. light_source = rackstone.light_source,
  297. after_destruct = function(...)
  298. after_redrack_remove(...)
  299. end,
  300. })
  301. minetest.register_node("rackstone:redrack_with_copper", {
  302. description = "Netherack With Copper",
  303. tiles = {
  304. "rackstone_redrack.png",
  305. "rackstone_redrack.png",
  306. "rackstone_redrack.png^default_mineral_copper3.png",
  307. "rackstone_redrack.png^default_mineral_copper3.png",
  308. "rackstone_redrack.png^default_mineral_copper3.png",
  309. "rackstone_redrack.png^default_mineral_copper3.png",
  310. },
  311. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1, ore=1}),
  312. sounds = rackstone.rackstone_sounds(),
  313. drop = "default:copper_lump",
  314. _tnt_drop = "default:copper_lump 2",
  315. silverpick_drop = true,
  316. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  317. place_param2 = 10,
  318. light_source = rackstone.light_source,
  319. after_destruct = function(...)
  320. after_redrack_remove(...)
  321. end,
  322. })
  323. minetest.register_craftitem("rackstone:dauth_lump", {
  324. description = "Dauth Lump",
  325. inventory_image = "rackstone_dauth_lump.png",
  326. })
  327. minetest.register_craft({
  328. type = "fuel",
  329. recipe = "rackstone:dauth_lump",
  330. burntime = 60,
  331. })
  332. minetest.register_node("rackstone:redrack_with_coal", {
  333. description = "Netherack With Dauth",
  334. tiles = {
  335. "rackstone_redrack.png",
  336. "rackstone_redrack.png",
  337. "rackstone_redrack.png^default_mineral_coal3.png",
  338. "rackstone_redrack.png^default_mineral_coal3.png",
  339. "rackstone_redrack.png^default_mineral_coal3.png",
  340. "rackstone_redrack.png^default_mineral_coal3.png",
  341. },
  342. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1}),
  343. sounds = rackstone.rackstone_sounds(),
  344. drop = "rackstone:dauth_lump",
  345. silverpick_drop = true,
  346. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  347. place_param2 = 10,
  348. light_source = rackstone.light_source,
  349. after_destruct = function(...)
  350. after_redrack_remove(...)
  351. end,
  352. })
  353. minetest.register_node("rackstone:redrack_with_tin", {
  354. description = "Netherack With Tin",
  355. tiles = {
  356. "rackstone_redrack.png",
  357. "rackstone_redrack.png",
  358. "rackstone_redrack.png^moreores_mineral_tin2.png",
  359. "rackstone_redrack.png^moreores_mineral_tin2.png",
  360. "rackstone_redrack.png^moreores_mineral_tin2.png",
  361. "rackstone_redrack.png^moreores_mineral_tin2.png",
  362. },
  363. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1, ore=1}),
  364. sounds = rackstone.rackstone_sounds(),
  365. drop = "moreores:tin_lump",
  366. _tnt_drop = "moreores:tin_lump 2",
  367. silverpick_drop = true,
  368. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  369. place_param2 = 10,
  370. light_source = rackstone.light_source,
  371. after_destruct = function(...)
  372. after_redrack_remove(...)
  373. end,
  374. })
  375. minetest.register_node("rackstone:tile", {
  376. description = "Nether Grit Tile",
  377. paramtype2 = "facedir",
  378. place_param2 = 0,
  379. tiles = {"rackstone_redtile.png"},
  380. groups = utility.dig_groups("brick", {brick=1}),
  381. sounds = default.node_sound_stone_defaults(),
  382. })
  383. minetest.register_node("rackstone:brick", {
  384. description = "Netherack Brick",
  385. paramtype2 = "facedir",
  386. place_param2 = 0,
  387. tiles = {"rackstone_brick.png"},
  388. groups = utility.dig_groups("brick", {brick=1}),
  389. sounds = default.node_sound_stone_defaults(),
  390. })
  391. minetest.register_node("rackstone:redrack_block", {
  392. description = "Netherack Block",
  393. paramtype2 = "facedir",
  394. place_param2 = 0,
  395. tiles = {"rackstone_redrack_block.png"},
  396. groups = utility.dig_groups("block"),
  397. sounds = default.node_sound_stone_defaults(),
  398. })
  399. minetest.register_node("rackstone:brick_black", {
  400. description = "Black Rackstone Brick",
  401. paramtype2 = "facedir",
  402. place_param2 = 0,
  403. tiles = {"rackstone_brick_black.png"},
  404. groups = utility.dig_groups("brick", {brick=1}),
  405. sounds = default.node_sound_stone_defaults(),
  406. })
  407. minetest.register_node("rackstone:blackrack_block", {
  408. description = "Black Rackstone Block",
  409. paramtype2 = "facedir",
  410. place_param2 = 0,
  411. tiles = {"rackstone_blackrack_block.png"},
  412. groups = utility.dig_groups("block"),
  413. sounds = default.node_sound_stone_defaults(),
  414. })
  415. minetest.register_node("rackstone:bluerack", {
  416. description = "Blue Rackstone",
  417. tiles = {"rackstone_bluerack.png"},
  418. groups = utility.dig_groups("hardstone", {rackstone=1, netherack=1}),
  419. sounds = rackstone.rackstone_sounds(),
  420. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  421. })
  422. minetest.register_node("rackstone:bluerack_brick", {
  423. description = "Blue Rackstone Brick",
  424. paramtype2 = "facedir",
  425. place_param2 = 0,
  426. tiles = {"rackstone_bluerack_brick.png"},
  427. groups = utility.dig_groups("brick", {rackstone=1, brick=1}),
  428. sounds = rackstone.rackstone_sounds(),
  429. })
  430. minetest.register_node("rackstone:bluerack_block", {
  431. description = "Blue Rackstone Block",
  432. paramtype2 = "facedir",
  433. place_param2 = 0,
  434. tiles = {"rackstone_bluerack_block.png"},
  435. groups = utility.dig_groups("block", {rackstone=1}),
  436. sounds = rackstone.rackstone_sounds(),
  437. })
  438. minetest.register_node("rackstone:blackrack", {
  439. description = "Black Rackstone",
  440. tiles = {"rackstone_blackrack.png"},
  441. groups = utility.dig_groups("cobble", {rackstone=1, native_stone=1, stabilize_dauthsand=1, netherack=1}),
  442. sounds = rackstone.rackstone_sounds(),
  443. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  444. paramtype2 = "none",
  445. after_destruct = rackstone.destabilize_dauthsand,
  446. _is_bulk_mapgen_stone = true,
  447. -- Nodes placed shall not produce starpearls when dug.
  448. after_place_node = function(pos, placer, itemstack, pointed_thing)
  449. if placer then
  450. local node = minetest.get_node(pos)
  451. node.param2 = 1
  452. minetest.swap_node(pos, node)
  453. end
  454. end,
  455. -- Digging nodes placed by mapgen shall sometimes produce starpearls.
  456. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  457. if digger and oldnode.param2 == 0 then
  458. -- Only drop them rarely.
  459. -- Only drop if blackrack was placed by mapgen.
  460. -- This prevents place-harvest-place-harvest exploit.
  461. -- Only if realm does NOT reset.
  462. local realm = rc.current_realm_at_pos(pos)
  463. local rdata = rc.get_realm_data(realm)
  464. if rdata and rdata.realm_resets then
  465. return
  466. end
  467. local chance = 80
  468. local tool = digger:get_wielded_item():get_name()
  469. if tool:find("pick") and tool:find("silver") then
  470. chance = 20
  471. end
  472. if math_random(1, chance) == 1 then
  473. local inv = digger:get_inventory()
  474. local leftover = inv:add_item("main", ItemStack('starpearl:pearl'))
  475. minetest.add_item(pos, leftover)
  476. end
  477. end
  478. end,
  479. })
  480. minetest.register_node("rackstone:evilrack", {
  481. description = "Witchrack",
  482. tiles = {"rackstone_evilstone.png"},
  483. groups = utility.dig_groups("netherack", {falling_node=1, rackstone=1, netherack=1}),
  484. sounds = rackstone.rackstone_sounds(),
  485. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  486. })
  487. minetest.register_node("rackstone:dauthsand", {
  488. description = "Dauthsand",
  489. tiles = {"rackstone_dauthsand.png"},
  490. groups = utility.dig_groups("racksand", {falling_node=1, racksand=1, nether_soil=1}),
  491. --damage_per_second = 4*500,
  492. post_effect_color = {a=255, r=0, g=0, b=0},
  493. sounds = default.node_sound_gravel_defaults(),
  494. drop = {
  495. items = {
  496. {items = {'bluegrass:seed'}, rarity = 32},
  497. {items = {'rackstone:dauthsand'}},
  498. {items = {'default:flint'}, rarity = 16}
  499. }
  500. },
  501. movement_speed_multiplier = default.SLOW_SPEED,
  502. -- Stabilize dauth sand if held by rackstone.
  503. on_construct = function(pos)
  504. local x1 = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}).name
  505. local x2 = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}).name
  506. local z1 = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}).name
  507. local z2 = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}).name
  508. if minetest.get_item_group(x1, "stabilize_dauthsand") > 0 and
  509. minetest.get_item_group(x2, "stabilize_dauthsand") > 0 then
  510. minetest.swap_node(pos, {name="rackstone:dauthsand_stable"})
  511. elseif minetest.get_item_group(z1, "stabilize_dauthsand") > 0 and
  512. minetest.get_item_group(z2, "stabilize_dauthsand") > 0 then
  513. minetest.swap_node(pos, {name="rackstone:dauthsand_stable"})
  514. end
  515. end,
  516. })
  517. -- Special sand type that doesn't fall.
  518. -- Not supposed to be player-obtainable.
  519. minetest.register_node("rackstone:dauthsand_stable", {
  520. description = "Stable Dauthsand (You Hacker)",
  521. tiles = {"rackstone_dauthsand.png"},
  522. groups = utility.dig_groups("gravel", {racksand=1, nether_soil=1}),
  523. --damage_per_second = 4*500,
  524. post_effect_color = {a=255, r=0, g=0, b=0},
  525. sounds = default.node_sound_gravel_defaults(),
  526. drop = 'rackstone:dauthsand',
  527. movement_speed_multiplier = default.SLOW_SPEED,
  528. on_finish_collapse = function(pos, node)
  529. minetest.swap_node(pos, {name="rackstone:dauthsand"})
  530. end,
  531. on_collapse_to_entity = function(pos, node)
  532. return {ItemStack("rackstone:dauthsand")}
  533. end,
  534. })
  535. minetest.register_craft({
  536. type = "cooking",
  537. output = "default:glass",
  538. recipe = "rackstone:dauthsand",
  539. })
  540. -- Netherack Crafts
  541. minetest.register_craft({
  542. output = "rackstone:brick 4",
  543. recipe = {
  544. {"rackstone:redrack", "rackstone:redrack"},
  545. {"rackstone:redrack", "rackstone:redrack"},
  546. }
  547. })
  548. minetest.register_craft({
  549. output = "rackstone:redrack_block 9",
  550. recipe = {
  551. {"rackstone:redrack", "rackstone:redrack", "rackstone:redrack"},
  552. {"rackstone:redrack", "rackstone:redrack", "rackstone:redrack"},
  553. {"rackstone:redrack", "rackstone:redrack", "rackstone:redrack"},
  554. }
  555. })
  556. -- Blue Rackstone Crafts
  557. minetest.register_craft({
  558. output = "rackstone:bluerack_brick 4",
  559. recipe = {
  560. {"rackstone:bluerack", "rackstone:bluerack"},
  561. {"rackstone:bluerack", "rackstone:bluerack"},
  562. }
  563. })
  564. minetest.register_craft({
  565. output = "rackstone:bluerack_block 9",
  566. recipe = {
  567. {"rackstone:bluerack", "rackstone:bluerack", "rackstone:bluerack"},
  568. {"rackstone:bluerack", "rackstone:bluerack", "rackstone:bluerack"},
  569. {"rackstone:bluerack", "rackstone:bluerack", "rackstone:bluerack"},
  570. }
  571. })
  572. -- Black Rackstone Crafts
  573. minetest.register_craft({
  574. output = "rackstone:brick_black 4",
  575. recipe = {
  576. {"rackstone:blackrack", "rackstone:blackrack"},
  577. {"rackstone:blackrack", "rackstone:blackrack"},
  578. }
  579. })
  580. minetest.register_craft({
  581. output = "rackstone:blackrack_block 9",
  582. recipe = {
  583. {"rackstone:blackrack", "rackstone:blackrack", "rackstone:blackrack"},
  584. {"rackstone:blackrack", "rackstone:blackrack", "rackstone:blackrack"},
  585. {"rackstone:blackrack", "rackstone:blackrack", "rackstone:blackrack"},
  586. }
  587. })
  588. -- Rackstone Crafts
  589. minetest.register_craft({
  590. output = "rackstone:rackstone_brick2 4",
  591. recipe = {
  592. {"rackstone:rackstone", "rackstone:rackstone"},
  593. {"rackstone:rackstone", "rackstone:rackstone"},
  594. }
  595. })
  596. minetest.register_craft({
  597. output = "rackstone:rackstone_block 9",
  598. recipe = {
  599. {"rackstone:rackstone", "rackstone:rackstone", "rackstone:rackstone"},
  600. {"rackstone:rackstone", "rackstone:rackstone", "rackstone:rackstone"},
  601. {"rackstone:rackstone", "rackstone:rackstone", "rackstone:rackstone"},
  602. }
  603. })
  604. minetest.register_craft({
  605. type = "cooking",
  606. output = 'rackstone:tile',
  607. recipe = 'rackstone:nether_grit',
  608. cooktime = 20,
  609. })
  610. minetest.register_craft({
  611. type = "cooking",
  612. output = 'rackstone:rackstone',
  613. recipe = 'rackstone:cobble',
  614. cooktime = 6,
  615. })
  616. minetest.register_craft({
  617. type = "cooking",
  618. output = 'rackstone:redrack',
  619. recipe = 'rackstone:redrack_cobble',
  620. cooktime = 3,
  621. })
  622. minetest.register_craft({
  623. type = "grinding",
  624. output = 'rackstone:dauthsand',
  625. recipe = 'rackstone:redrack',
  626. time = 20,
  627. })
  628. minetest.register_craft({
  629. type = "crushing",
  630. output = 'rackstone:nether_grit',
  631. recipe = 'rackstone:redrack',
  632. time = 60*1.0,
  633. })
  634. minetest.register_craft({
  635. type = "crushing",
  636. output = 'rackstone:dauthsand',
  637. recipe = 'rackstone:nether_grit',
  638. time = 60*1.0,
  639. })
  640. -- Rackstone
  641. stairs.register_stair_and_slab(
  642. "rackstone",
  643. "rackstone:rackstone",
  644. {cracky=1},
  645. {"rackstone_rackstone.png"},
  646. "Rackstone",
  647. default.node_sound_stone_defaults()
  648. )
  649. stairs.register_stair_and_slab(
  650. "rackstone_cobble",
  651. "rackstone:cobble",
  652. {cracky=2},
  653. {"rackstone_rackstone_cobble.png"},
  654. "Rackstone Cobble",
  655. default.node_sound_stone_defaults()
  656. )
  657. -- Rackstone Block
  658. stairs.register_stair_and_slab(
  659. "rackstone_block",
  660. "rackstone:rackstone_block",
  661. {cracky=1},
  662. {"rackstone_rackstone_block.png"},
  663. "Rackstone Block",
  664. default.node_sound_stone_defaults()
  665. )
  666. -- Rackstone Brick
  667. stairs.register_stair_and_slab(
  668. "rackstone_brick2",
  669. "rackstone:rackstone_brick2",
  670. {cracky=1},
  671. {"rackstone_rackstone_brick.png"},
  672. "Rackstone Brick",
  673. default.node_sound_stone_defaults()
  674. )
  675. -- Netherack
  676. stairs.register_stair_and_slab(
  677. "redrack",
  678. "rackstone:redrack",
  679. {cracky=3},
  680. {"rackstone_redrack.png"},
  681. "Netherack",
  682. rackstone.rackstone_sounds()
  683. )
  684. stairs.register_stair_and_slab(
  685. "redrack_cobble",
  686. "rackstone:redrack_cobble",
  687. {cracky=3},
  688. {"rackstone_redrack_cobble.png"},
  689. "Cobbled Netherack",
  690. rackstone.rackstone_sounds()
  691. )
  692. -- Netherack Block
  693. stairs.register_stair_and_slab(
  694. "redrack_block",
  695. "rackstone:redrack_block",
  696. {cracky=3},
  697. {"rackstone_redrack_block.png"},
  698. "Netherack Block",
  699. default.node_sound_stone_defaults()
  700. )
  701. -- Netherack Brick
  702. stairs.register_stair_and_slab(
  703. "rackstone_brick",
  704. "rackstone:brick",
  705. {cracky=2},
  706. {"rackstone_brick.png"},
  707. "Rackstone Brick",
  708. default.node_sound_stone_defaults()
  709. )
  710. -- Blue Rackstone
  711. stairs.register_stair_and_slab(
  712. "bluerack",
  713. "rackstone:bluerack",
  714. {cracky=2},
  715. {"rackstone_bluerack.png"},
  716. "Blue Rackstone",
  717. rackstone.rackstone_sounds()
  718. )
  719. -- Blue Rackstone Block
  720. stairs.register_stair_and_slab(
  721. "bluerack_block",
  722. "rackstone:bluerack_block",
  723. {cracky=2},
  724. {"rackstone_bluerack.png"},
  725. "Blue Rackstone Block",
  726. default.node_sound_stone_defaults()
  727. )
  728. -- Blue Rackstone Brick
  729. stairs.register_stair_and_slab(
  730. "bluerack_brick",
  731. "rackstone:bluerack_brick",
  732. {cracky=2},
  733. {"rackstone_bluerack_brick.png"},
  734. "Blue Rackstone Brick",
  735. default.node_sound_stone_defaults()
  736. )
  737. -- Blackrack
  738. stairs.register_stair_and_slab(
  739. "blackrack",
  740. "rackstone:blackrack",
  741. {cracky=2},
  742. {"rackstone_blackrack.png"},
  743. "Black Rackstone",
  744. rackstone.rackstone_sounds()
  745. )
  746. -- Black Rackstone Block
  747. stairs.register_stair_and_slab(
  748. "blackrack_block",
  749. "rackstone:blackrack_block",
  750. {cracky=2},
  751. {"rackstone_blackrack_block.png"},
  752. "Black Rackstone Block",
  753. default.node_sound_stone_defaults()
  754. )
  755. -- Black Rackstone Brick
  756. stairs.register_stair_and_slab(
  757. "rackstone_brick_black",
  758. "rackstone:brick_black",
  759. {cracky=2},
  760. {"rackstone_brick_black.png"},
  761. "Black Rackstone Brick",
  762. default.node_sound_stone_defaults()
  763. )
  764. -- These nodes appear only in the Outback.
  765. -- They have enhanced drops in order to help new players.
  766. minetest.register_node("rackstone:rackstone_with_coal", {
  767. description = "Rackstone With Coal",
  768. tiles = {"rackstone_rackstone.png^default_mineral_coal.png"},
  769. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1}),
  770. sounds = default.node_sound_stone_defaults(),
  771. drop = "default:coal_lump 3",
  772. silverpick_drop = true,
  773. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  774. place_param2 = 10,
  775. })
  776. minetest.register_node("rackstone:rackstone_with_iron", {
  777. description = "Rackstone With Iron",
  778. tiles = {"rackstone_rackstone.png^default_mineral_iron.png"},
  779. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1}),
  780. sounds = default.node_sound_stone_defaults(),
  781. drop = "default:iron_lump 3",
  782. silverpick_drop = true,
  783. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  784. place_param2 = 10,
  785. })
  786. minetest.register_node("rackstone:rackstone_with_copper", {
  787. description = "Rackstone With Copper",
  788. tiles = {"rackstone_rackstone.png^default_mineral_copper.png"},
  789. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1}),
  790. sounds = default.node_sound_stone_defaults(),
  791. drop = "default:copper_lump 2",
  792. silverpick_drop = true,
  793. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  794. place_param2 = 10,
  795. })
  796. minetest.register_node("rackstone:rackstone_with_gold", {
  797. description = "Rackstone With Gold",
  798. tiles = {"rackstone_rackstone.png^default_mineral_gold.png"},
  799. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1}),
  800. sounds = default.node_sound_stone_defaults(),
  801. drop = "default:gold_lump 2",
  802. silverpick_drop = true,
  803. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  804. place_param2 = 10,
  805. })
  806. minetest.register_node("rackstone:rackstone_with_diamond", {
  807. description = "Rackstone With Diamond",
  808. tiles = {"rackstone_rackstone.png^default_mineral_diamond.png"},
  809. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1}),
  810. sounds = default.node_sound_stone_defaults(),
  811. drop = "default:diamond 2",
  812. _tnt_drop = {
  813. 'default:diamond 2',
  814. 'dusts:diamond_shard 3',
  815. },
  816. silverpick_drop = true,
  817. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  818. place_param2 = 10,
  819. })
  820. minetest.register_node("rackstone:rackstone_with_mese", {
  821. description = "Rackstone With Mese",
  822. tiles = {"rackstone_rackstone.png^default_mineral_mese.png"},
  823. groups = utility.dig_groups("mineral", {rackstone=1, netherack=1}),
  824. sounds = default.node_sound_stone_defaults(),
  825. drop = "default:mese_crystal 2",
  826. _tnt_drop = "default:mese_crystal_fragment 2",
  827. silverpick_drop = true,
  828. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  829. place_param2 = 10,
  830. })
  831. minetest.register_node("rackstone:rackstone_with_meat", {
  832. description = "Rackstone With Unidentified Meat",
  833. tiles = {"rackstone_rackstone.png^rackstone_meat.png"},
  834. groups = utility.dig_groups("netherack", {rackstone=1, netherack=1}),
  835. sounds = default.node_sound_stone_defaults(),
  836. drop = "mobs:meat_raw 4",
  837. silverpick_drop = true,
  838. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  839. place_param2 = 10,
  840. })