init.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. stairs = {}
  2. -- Node will be called stairs:stair_<subname>
  3. function stairs.register_stair(subname, recipeitem, groups, images, description)
  4. minetest.register_node(":stairs:stair_" .. subname, {
  5. description = description,
  6. drawtype = "nodebox",
  7. tiles = images,
  8. paramtype = "light",
  9. paramtype2 = "facedir",
  10. is_ground_content = true,
  11. groups = groups,
  12. node_box = {
  13. type = "fixed",
  14. fixed = {
  15. {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  16. {-0.5, 0, 0, 0.5, 0.5, 0.5},
  17. },
  18. },
  19. })
  20. end
  21. -- Node will be called stairs:slab_<subname>
  22. function stairs.register_slab(subname, recipeitem, groups, images, description)
  23. minetest.register_node(":stairs:slab_" .. subname, {
  24. description = description,
  25. drawtype = "nodebox",
  26. tiles = images,
  27. paramtype = "light",
  28. is_ground_content = true,
  29. groups = groups,
  30. node_box = {
  31. type = "fixed",
  32. fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  33. },
  34. selection_box = {
  35. type = "fixed",
  36. fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  37. },
  38. })
  39. end
  40. -- Nodes will be called stairs:{stair,slab}_<subname>
  41. function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
  42. stairs.register_stair(subname, recipeitem, groups, images, desc_stair)
  43. stairs.register_slab(subname, recipeitem, groups, images, desc_slab)
  44. end
  45. stairs.register_stair_and_slab("stone", "basenodes:stone",
  46. {cracky=3},
  47. {"default_stone.png"},
  48. "Stone Stair",
  49. "Stone Slab")
  50. stairs.register_stair_and_slab("desert_stone", "basenodes:desert_stone",
  51. {cracky=3},
  52. {"default_desert_stone.png"},
  53. "Desert Stone Stair",
  54. "Desert Stone Slab")
  55. stairs.register_stair_and_slab("cobble", "basenodes:cobble",
  56. {cracky=3},
  57. {"default_cobble.png"},
  58. "Cobblestone Stair",
  59. "Cobblestone Slab")