init.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. -- Minetest 0.4 mod: stairs
  2. -- See README.txt for licensing and other information.
  3. -- Global namespace for functions
  4. stairs = {}
  5. -- Register aliases for new pine node names
  6. minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood")
  7. minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
  8. -- Get setting for replace ABM
  9. local replace = minetest.settings:get_bool("enable_stairs_replace_abm")
  10. local function rotate_and_place(itemstack, placer, pointed_thing)
  11. local p0 = pointed_thing.under
  12. local p1 = pointed_thing.above
  13. local param2 = 0
  14. if placer then
  15. local placer_pos = placer:getpos()
  16. if placer_pos then
  17. param2 = minetest.dir_to_facedir(vector.subtract(p1, placer_pos))
  18. end
  19. local finepos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
  20. local fpos = finepos.y % 1
  21. if p0.y - 1 == p1.y or (fpos > 0 and fpos < 0.5)
  22. or (fpos < -0.5 and fpos > -0.999999999) then
  23. param2 = param2 + 20
  24. if param2 == 21 then
  25. param2 = 23
  26. elseif param2 == 23 then
  27. param2 = 21
  28. end
  29. end
  30. end
  31. return minetest.item_place(itemstack, placer, pointed_thing, param2)
  32. end
  33. -- Register stairs.
  34. -- Node will be called stairs:stair_<subname>
  35. function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
  36. -- Set backface culling and world-aligned textures
  37. local stair_images = {}
  38. for i, image in ipairs(images) do
  39. if type(image) == "string" then
  40. stair_images[i] = {
  41. name = image,
  42. backface_culling = true,
  43. align_style = "world",
  44. }
  45. else
  46. stair_images[i] = table.copy(image)
  47. if stair_images[i].backface_culling == nil then
  48. stair_images[i].backface_culling = true
  49. end
  50. if stair_images[i].align_style == nil then
  51. stair_images[i].align_style = "world"
  52. end
  53. end
  54. end
  55. groups.stair = 1
  56. minetest.register_node(":stairs:stair_" .. subname, {
  57. description = description,
  58. drawtype = "nodebox",
  59. tiles = stair_images,
  60. paramtype = "light",
  61. paramtype2 = "facedir",
  62. is_ground_content = false,
  63. groups = groups,
  64. sounds = sounds,
  65. node_box = {
  66. type = "fixed",
  67. fixed = {
  68. {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
  69. {-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
  70. },
  71. },
  72. on_place = function(itemstack, placer, pointed_thing)
  73. if pointed_thing.type ~= "node" then
  74. return itemstack
  75. end
  76. return rotate_and_place(itemstack, placer, pointed_thing)
  77. end,
  78. })
  79. -- for replace ABM
  80. if replace then
  81. minetest.register_node(":stairs:stair_" .. subname .. "upside_down", {
  82. replace_name = "stairs:stair_" .. subname,
  83. groups = {slabs_replace = 1},
  84. })
  85. end
  86. if recipeitem then
  87. -- Recipe matches appearence in inventory
  88. minetest.register_craft({
  89. output = 'stairs:stair_' .. subname .. ' 8',
  90. recipe = {
  91. {"", "", recipeitem},
  92. {"", recipeitem, recipeitem},
  93. {recipeitem, recipeitem, recipeitem},
  94. },
  95. })
  96. -- Use stairs to craft full blocks again (1:1)
  97. minetest.register_craft({
  98. output = recipeitem .. ' 3',
  99. recipe = {
  100. {'stairs:stair_' .. subname, 'stairs:stair_' .. subname},
  101. {'stairs:stair_' .. subname, 'stairs:stair_' .. subname},
  102. },
  103. })
  104. -- Fuel
  105. local baseburntime = minetest.get_craft_result({
  106. method = "fuel",
  107. width = 1,
  108. items = {recipeitem}
  109. }).time
  110. if baseburntime > 0 then
  111. minetest.register_craft({
  112. type = "fuel",
  113. recipe = 'stairs:stair_' .. subname,
  114. burntime = math.floor(baseburntime * 0.75),
  115. })
  116. end
  117. end
  118. end
  119. -- Slab facedir to placement 6d matching table
  120. local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4}
  121. -- Register slabs.
  122. -- Node will be called stairs:slab_<subname>
  123. function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
  124. -- Set world-aligned textures
  125. local slab_images = {}
  126. for i, image in ipairs(images) do
  127. if type(image) == "string" then
  128. slab_images[i] = {
  129. name = image,
  130. align_style = "world",
  131. }
  132. else
  133. slab_images[i] = table.copy(image)
  134. if image.align_style == nil then
  135. slab_images[i].align_style = "world"
  136. end
  137. end
  138. end
  139. groups.slab = 1
  140. minetest.register_node(":stairs:slab_" .. subname, {
  141. description = description,
  142. drawtype = "nodebox",
  143. tiles = slab_images,
  144. paramtype = "light",
  145. paramtype2 = "facedir",
  146. is_ground_content = false,
  147. groups = groups,
  148. sounds = sounds,
  149. node_box = {
  150. type = "fixed",
  151. fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  152. },
  153. on_place = function(itemstack, placer, pointed_thing)
  154. local under = minetest.get_node(pointed_thing.under)
  155. local wield_item = itemstack:get_name()
  156. local player_name = placer and placer:get_player_name() or ""
  157. local creative_enabled = (creative and creative.is_enabled_for
  158. and creative.is_enabled_for(player_name))
  159. if under and under.name:find("stairs:slab_") then
  160. -- place slab using under node orientation
  161. local dir = minetest.dir_to_facedir(vector.subtract(
  162. pointed_thing.above, pointed_thing.under), true)
  163. local p2 = under.param2
  164. -- combine two slabs if possible
  165. if slab_trans_dir[math.floor(p2 / 4)] == dir
  166. and wield_item == under.name then
  167. if not recipeitem then
  168. return itemstack
  169. end
  170. if minetest.is_protected(pointed_thing.under, player_name) and not
  171. minetest.check_player_privs(player_name, "protection_bypass") then
  172. minetest.record_protection_violation(pointed_thing.under,
  173. player_name)
  174. return
  175. end
  176. minetest.set_node(pointed_thing.under, {name = recipeitem, param2 = p2})
  177. if not creative_enabled then
  178. itemstack:take_item()
  179. end
  180. return itemstack
  181. end
  182. -- Placing a slab on an upside down slab should make it right-side up.
  183. if p2 >= 20 and dir == 8 then
  184. p2 = p2 - 20
  185. -- same for the opposite case: slab below normal slab
  186. elseif p2 <= 3 and dir == 4 then
  187. p2 = p2 + 20
  188. end
  189. -- else attempt to place node with proper param2
  190. minetest.item_place_node(ItemStack(wield_item), placer, pointed_thing, p2)
  191. if not creative_enabled then
  192. itemstack:take_item()
  193. end
  194. return itemstack
  195. else
  196. return rotate_and_place(itemstack, placer, pointed_thing)
  197. end
  198. end,
  199. })
  200. -- for replace ABM
  201. if replace then
  202. minetest.register_node(":stairs:slab_" .. subname .. "upside_down", {
  203. replace_name = "stairs:slab_".. subname,
  204. groups = {slabs_replace = 1},
  205. })
  206. end
  207. if recipeitem then
  208. minetest.register_craft({
  209. output = 'stairs:slab_' .. subname .. ' 6',
  210. recipe = {
  211. {recipeitem, recipeitem, recipeitem},
  212. },
  213. })
  214. -- Use 2 slabs to craft a full block again (1:1)
  215. minetest.register_craft({
  216. output = recipeitem,
  217. recipe = {
  218. {'stairs:slab_' .. subname},
  219. {'stairs:slab_' .. subname},
  220. },
  221. })
  222. -- Fuel
  223. local baseburntime = minetest.get_craft_result({
  224. method = "fuel",
  225. width = 1,
  226. items = {recipeitem}
  227. }).time
  228. if baseburntime > 0 then
  229. minetest.register_craft({
  230. type = "fuel",
  231. recipe = 'stairs:slab_' .. subname,
  232. burntime = math.floor(baseburntime * 0.5),
  233. })
  234. end
  235. end
  236. end
  237. -- Optionally replace old "upside_down" nodes with new param2 versions.
  238. -- Disabled by default.
  239. if replace then
  240. minetest.register_abm({
  241. label = "Slab replace",
  242. nodenames = {"group:slabs_replace"},
  243. interval = 16,
  244. chance = 1,
  245. action = function(pos, node)
  246. node.name = minetest.registered_nodes[node.name].replace_name
  247. node.param2 = node.param2 + 20
  248. if node.param2 == 21 then
  249. node.param2 = 23
  250. elseif node.param2 == 23 then
  251. node.param2 = 21
  252. end
  253. minetest.set_node(pos, node)
  254. end,
  255. })
  256. end
  257. -- Register stairs.
  258. -- Node will be called stairs:stair_inner_<subname>
  259. function stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds)
  260. -- Set backface culling and world-aligned textures
  261. local stair_images = {}
  262. for i, image in ipairs(images) do
  263. if type(image) == "string" then
  264. stair_images[i] = {
  265. name = image,
  266. backface_culling = true,
  267. align_style = "world",
  268. }
  269. else
  270. stair_images[i] = table.copy(image)
  271. if stair_images[i].backface_culling == nil then
  272. stair_images[i].backface_culling = true
  273. end
  274. if stair_images[i].align_style == nil then
  275. stair_images[i].align_style = "world"
  276. end
  277. end
  278. end
  279. groups.stair = 1
  280. minetest.register_node(":stairs:stair_inner_" .. subname, {
  281. description = description .. " Inner",
  282. drawtype = "nodebox",
  283. tiles = stair_images,
  284. paramtype = "light",
  285. paramtype2 = "facedir",
  286. is_ground_content = false,
  287. groups = groups,
  288. sounds = sounds,
  289. node_box = {
  290. type = "fixed",
  291. fixed = {
  292. {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
  293. {-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
  294. {-0.5, 0.0, -0.5, 0.0, 0.5, 0.0},
  295. },
  296. },
  297. on_place = function(itemstack, placer, pointed_thing)
  298. if pointed_thing.type ~= "node" then
  299. return itemstack
  300. end
  301. return rotate_and_place(itemstack, placer, pointed_thing)
  302. end,
  303. })
  304. if recipeitem then
  305. minetest.register_craft({
  306. output = 'stairs:stair_inner_' .. subname .. ' 7',
  307. recipe = {
  308. { "", recipeitem, ""},
  309. { recipeitem, "", recipeitem},
  310. {recipeitem, recipeitem, recipeitem},
  311. },
  312. })
  313. -- Fuel
  314. local baseburntime = minetest.get_craft_result({
  315. method = "fuel",
  316. width = 1,
  317. items = {recipeitem}
  318. }).time
  319. if baseburntime > 0 then
  320. minetest.register_craft({
  321. type = "fuel",
  322. recipe = 'stairs:stair_inner_' .. subname,
  323. burntime = math.floor(baseburntime * 0.875),
  324. })
  325. end
  326. end
  327. end
  328. -- Register stairs.
  329. -- Node will be called stairs:stair_outer_<subname>
  330. function stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds)
  331. -- Set backface culling and world-aligned textures
  332. local stair_images = {}
  333. for i, image in ipairs(images) do
  334. if type(image) == "string" then
  335. stair_images[i] = {
  336. name = image,
  337. backface_culling = true,
  338. align_style = "world",
  339. }
  340. else
  341. stair_images[i] = table.copy(image)
  342. if stair_images[i].backface_culling == nil then
  343. stair_images[i].backface_culling = true
  344. end
  345. if stair_images[i].align_style == nil then
  346. stair_images[i].align_style = "world"
  347. end
  348. end
  349. end
  350. groups.stair = 1
  351. minetest.register_node(":stairs:stair_outer_" .. subname, {
  352. description = description .. " Outer",
  353. drawtype = "nodebox",
  354. tiles = stair_images,
  355. paramtype = "light",
  356. paramtype2 = "facedir",
  357. is_ground_content = false,
  358. groups = groups,
  359. sounds = sounds,
  360. node_box = {
  361. type = "fixed",
  362. fixed = {
  363. {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
  364. {-0.5, 0.0, 0.0, 0.0, 0.5, 0.5},
  365. },
  366. },
  367. on_place = function(itemstack, placer, pointed_thing)
  368. if pointed_thing.type ~= "node" then
  369. return itemstack
  370. end
  371. return rotate_and_place(itemstack, placer, pointed_thing)
  372. end,
  373. })
  374. if recipeitem then
  375. minetest.register_craft({
  376. output = 'stairs:stair_outer_' .. subname .. ' 6',
  377. recipe = {
  378. { "", "", ""},
  379. { "", recipeitem, ""},
  380. {recipeitem, recipeitem, recipeitem},
  381. },
  382. })
  383. -- Fuel
  384. local baseburntime = minetest.get_craft_result({
  385. method = "fuel",
  386. width = 1,
  387. items = {recipeitem}
  388. }).time
  389. if baseburntime > 0 then
  390. minetest.register_craft({
  391. type = "fuel",
  392. recipe = 'stairs:stair_outer_' .. subname,
  393. burntime = math.floor(baseburntime * 0.625),
  394. })
  395. end
  396. end
  397. end
  398. -- Stair/slab registration function.
  399. -- Nodes will be called stairs:{stair,slab}_<subname>
  400. function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
  401. stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
  402. stairs.register_stair_inner(subname, recipeitem, groups, images, desc_stair, sounds)
  403. stairs.register_stair_outer(subname, recipeitem, groups, images, desc_stair, sounds)
  404. stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
  405. end
  406. -- Register default stairs and slabs
  407. stairs.register_stair_and_slab(
  408. "wood",
  409. "default:wood",
  410. {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  411. {"default_wood.png"},
  412. "Wooden Stair",
  413. "Wooden Slab",
  414. default.node_sound_wood_defaults()
  415. )
  416. stairs.register_stair_and_slab(
  417. "junglewood",
  418. "default:junglewood",
  419. {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  420. {"default_junglewood.png"},
  421. "Jungle Wood Stair",
  422. "Jungle Wood Slab",
  423. default.node_sound_wood_defaults()
  424. )
  425. stairs.register_stair_and_slab(
  426. "pine_wood",
  427. "default:pine_wood",
  428. {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  429. {"default_pine_wood.png"},
  430. "Pine Wood Stair",
  431. "Pine Wood Slab",
  432. default.node_sound_wood_defaults()
  433. )
  434. stairs.register_stair_and_slab(
  435. "acacia_wood",
  436. "default:acacia_wood",
  437. {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  438. {"default_acacia_wood.png"},
  439. "Acacia Wood Stair",
  440. "Acacia Wood Slab",
  441. default.node_sound_wood_defaults()
  442. )
  443. stairs.register_stair_and_slab(
  444. "aspen_wood",
  445. "default:aspen_wood",
  446. {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  447. {"default_aspen_wood.png"},
  448. "Aspen Wood Stair",
  449. "Aspen Wood Slab",
  450. default.node_sound_wood_defaults()
  451. )
  452. stairs.register_stair_and_slab(
  453. "stone",
  454. "default:stone",
  455. {cracky = 3},
  456. {"default_stone.png"},
  457. "Stone Stair",
  458. "Stone Slab",
  459. default.node_sound_stone_defaults()
  460. )
  461. stairs.register_stair_and_slab(
  462. "cobble",
  463. "default:cobble",
  464. {cracky = 3},
  465. {"default_cobble.png"},
  466. "Cobblestone Stair",
  467. "Cobblestone Slab",
  468. default.node_sound_stone_defaults()
  469. )
  470. stairs.register_stair_and_slab(
  471. "mossycobble",
  472. "default:mossycobble",
  473. {cracky = 3},
  474. {"default_mossycobble.png"},
  475. "Mossy Cobblestone Stair",
  476. "Mossy Cobblestone Slab",
  477. default.node_sound_stone_defaults()
  478. )
  479. stairs.register_stair_and_slab(
  480. "stonebrick",
  481. "default:stonebrick",
  482. {cracky = 2},
  483. {"default_stone_brick.png"},
  484. "Stone Brick Stair",
  485. "Stone Brick Slab",
  486. default.node_sound_stone_defaults()
  487. )
  488. stairs.register_stair_and_slab(
  489. "stone_block",
  490. "default:stone_block",
  491. {cracky = 2},
  492. {"default_stone_block.png"},
  493. "Stone Block Stair",
  494. "Stone Block Slab",
  495. default.node_sound_stone_defaults()
  496. )
  497. stairs.register_stair_and_slab(
  498. "desert_stone",
  499. "default:desert_stone",
  500. {cracky = 3},
  501. {"default_desert_stone.png"},
  502. "Desert Stone Stair",
  503. "Desert Stone Slab",
  504. default.node_sound_stone_defaults()
  505. )
  506. stairs.register_stair_and_slab(
  507. "desert_cobble",
  508. "default:desert_cobble",
  509. {cracky = 3},
  510. {"default_desert_cobble.png"},
  511. "Desert Cobblestone Stair",
  512. "Desert Cobblestone Slab",
  513. default.node_sound_stone_defaults()
  514. )
  515. stairs.register_stair_and_slab(
  516. "desert_stonebrick",
  517. "default:desert_stonebrick",
  518. {cracky = 2},
  519. {"default_desert_stone_brick.png"},
  520. "Desert Stone Brick Stair",
  521. "Desert Stone Brick Slab",
  522. default.node_sound_stone_defaults()
  523. )
  524. stairs.register_stair_and_slab(
  525. "desert_stone_block",
  526. "default:desert_stone_block",
  527. {cracky = 2},
  528. {"default_desert_stone_block.png"},
  529. "Desert Stone Block Stair",
  530. "Desert Stone Block Slab",
  531. default.node_sound_stone_defaults()
  532. )
  533. stairs.register_stair_and_slab(
  534. "sandstone",
  535. "default:sandstone",
  536. {crumbly = 1, cracky = 3},
  537. {"default_sandstone.png"},
  538. "Sandstone Stair",
  539. "Sandstone Slab",
  540. default.node_sound_stone_defaults()
  541. )
  542. stairs.register_stair_and_slab(
  543. "sandstonebrick",
  544. "default:sandstonebrick",
  545. {cracky = 2},
  546. {"default_sandstone_brick.png"},
  547. "Sandstone Brick Stair",
  548. "Sandstone Brick Slab",
  549. default.node_sound_stone_defaults()
  550. )
  551. stairs.register_stair_and_slab(
  552. "sandstone_block",
  553. "default:sandstone_block",
  554. {cracky = 2},
  555. {"default_sandstone_block.png"},
  556. "Sandstone Block Stair",
  557. "Sandstone Block Slab",
  558. default.node_sound_stone_defaults()
  559. )
  560. stairs.register_stair_and_slab(
  561. "desert_sandstone",
  562. "default:desert_sandstone",
  563. {crumbly = 1, cracky = 3},
  564. {"default_desert_sandstone.png"},
  565. "Desert Sandstone Stair",
  566. "Desert Sandstone Slab",
  567. default.node_sound_stone_defaults()
  568. )
  569. stairs.register_stair_and_slab(
  570. "desert_sandstone_brick",
  571. "default:desert_sandstone_brick",
  572. {cracky = 2},
  573. {"default_desert_sandstone_brick.png"},
  574. "Desert Sandstone Brick Stair",
  575. "Desert Sandstone Brick Slab",
  576. default.node_sound_stone_defaults()
  577. )
  578. stairs.register_stair_and_slab(
  579. "desert_sandstone_block",
  580. "default:desert_sandstone_block",
  581. {cracky = 2},
  582. {"default_desert_sandstone_block.png"},
  583. "Desert Sandstone Block Stair",
  584. "Desert Sandstone Block Slab",
  585. default.node_sound_stone_defaults()
  586. )
  587. stairs.register_stair_and_slab(
  588. "silver_sandstone",
  589. "default:silver_sandstone",
  590. {crumbly = 1, cracky = 3},
  591. {"default_silver_sandstone.png"},
  592. "Silver Sandstone Stair",
  593. "Silver Sandstone Slab",
  594. default.node_sound_stone_defaults()
  595. )
  596. stairs.register_stair_and_slab(
  597. "silver_sandstone_brick",
  598. "default:silver_sandstone_brick",
  599. {cracky = 2},
  600. {"default_silver_sandstone_brick.png"},
  601. "Silver Sandstone Brick Stair",
  602. "Silver Sandstone Brick Slab",
  603. default.node_sound_stone_defaults()
  604. )
  605. stairs.register_stair_and_slab(
  606. "silver_sandstone_block",
  607. "default:silver_sandstone_block",
  608. {cracky = 2},
  609. {"default_silver_sandstone_block.png"},
  610. "Silver Sandstone Block Stair",
  611. "Silver Sandstone Block Slab",
  612. default.node_sound_stone_defaults()
  613. )
  614. stairs.register_stair_and_slab(
  615. "obsidian",
  616. "default:obsidian",
  617. {cracky = 1, level = 2},
  618. {"default_obsidian.png"},
  619. "Obsidian Stair",
  620. "Obsidian Slab",
  621. default.node_sound_stone_defaults()
  622. )
  623. stairs.register_stair_and_slab(
  624. "obsidianbrick",
  625. "default:obsidianbrick",
  626. {cracky = 1, level = 2},
  627. {"default_obsidian_brick.png"},
  628. "Obsidian Brick Stair",
  629. "Obsidian Brick Slab",
  630. default.node_sound_stone_defaults()
  631. )
  632. stairs.register_stair_and_slab(
  633. "obsidian_block",
  634. "default:obsidian_block",
  635. {cracky = 1, level = 2},
  636. {"default_obsidian_block.png"},
  637. "Obsidian Block Stair",
  638. "Obsidian Block Slab",
  639. default.node_sound_stone_defaults()
  640. )
  641. stairs.register_stair_and_slab(
  642. "brick",
  643. "default:brick",
  644. {cracky = 3},
  645. {"default_brick.png"},
  646. "Brick Stair",
  647. "Brick Slab",
  648. default.node_sound_stone_defaults()
  649. )
  650. stairs.register_stair_and_slab(
  651. "steelblock",
  652. "default:steelblock",
  653. {cracky = 1, level = 2},
  654. {"default_steel_block.png"},
  655. "Steel Block Stair",
  656. "Steel Block Slab",
  657. default.node_sound_metal_defaults()
  658. )
  659. stairs.register_stair_and_slab(
  660. "tinblock",
  661. "default:tinblock",
  662. {cracky = 1, level = 2},
  663. {"default_tin_block.png"},
  664. "Tin Block Stair",
  665. "Tin Block Slab",
  666. default.node_sound_metal_defaults()
  667. )
  668. stairs.register_stair_and_slab(
  669. "copperblock",
  670. "default:copperblock",
  671. {cracky = 1, level = 2},
  672. {"default_copper_block.png"},
  673. "Copper Block Stair",
  674. "Copper Block Slab",
  675. default.node_sound_metal_defaults()
  676. )
  677. stairs.register_stair_and_slab(
  678. "bronzeblock",
  679. "default:bronzeblock",
  680. {cracky = 1, level = 2},
  681. {"default_bronze_block.png"},
  682. "Bronze Block Stair",
  683. "Bronze Block Slab",
  684. default.node_sound_metal_defaults()
  685. )
  686. stairs.register_stair_and_slab(
  687. "goldblock",
  688. "default:goldblock",
  689. {cracky = 1},
  690. {"default_gold_block.png"},
  691. "Gold Block Stair",
  692. "Gold Block Slab",
  693. default.node_sound_metal_defaults()
  694. )
  695. stairs.register_stair_and_slab(
  696. "ice",
  697. "default:ice",
  698. {cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 3},
  699. {"default_ice.png"},
  700. "Ice Stair",
  701. "Ice Slab",
  702. default.node_sound_glass_defaults()
  703. )
  704. stairs.register_stair_and_slab(
  705. "snowblock",
  706. "default:snowblock",
  707. {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
  708. {"default_snow.png"},
  709. "Snow Block Stair",
  710. "Snow Block Slab",
  711. default.node_sound_snow_defaults()
  712. )