init.lua 1.8 KB

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