init.lua 19 KB

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