init.lua 27 KB

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