columns.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --Column Nodes designed by Arthemis ( from the Middle-Ages Mod)
  2. --Licensed: WTFPL
  3. --
  4. --base code is from default minetest stairs mod
  5. --Licensed under GPLv3 or later, see http://www.gnu.org/licenses/gpl-3.0.html
  6. function lapis.register_column(modname, item, groups, images, description)
  7. local recipeitem = modname..":"..item
  8. local itemname = modname..":column_"..item
  9. minetest.register_node(itemname, {
  10. description = description .. " Column",
  11. drawtype = "nodebox",
  12. tiles = images,
  13. paramtype = "light",
  14. paramtype2 = "facedir",
  15. is_ground_content = false,
  16. groups = groups,
  17. node_box = {
  18. type = "fixed",
  19. fixed = {
  20. {-0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125}, -- NodeBox1
  21. {-0.25, -0.5, -0.375, 0.25, 0.5, 0.375}, -- NodeBox2
  22. {-0.375, -0.5, -0.25, 0.375, 0.5, 0.25}, -- NodeBox3
  23. {-0.1875, -0.5, -0.4375, 0.1875, 0.5, 0.4375}, -- NodeBox4
  24. {-0.4375, -0.5, -0.1875, 0.4375, 0.5, 0.1875}, -- NodeBox5
  25. },
  26. },
  27. selection_box = {
  28. type = "fixed",
  29. fixed = {
  30. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  31. },
  32. },
  33. on_place = minetest.rotate_node,
  34. })
  35. minetest.register_craft({
  36. output = itemname .. ' 6',
  37. recipe = {
  38. { "", recipeitem, ""},
  39. { "", recipeitem, ""},
  40. { "", recipeitem, ""},
  41. },
  42. })
  43. itemname=modname..":base_" .. item
  44. minetest.register_node(itemname, {
  45. description = description .. " Column Base",
  46. drawtype = "nodebox",
  47. tiles = images,
  48. paramtype = "light",
  49. paramtype2 = "facedir",
  50. is_ground_content = false,
  51. groups = groups,
  52. node_box = {
  53. type = "fixed",
  54. fixed = {
  55. {-0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125}, -- NodeBox2
  56. {-0.25, -0.5, -0.375, 0.25, 0.5, 0.375}, -- NodeBox3
  57. {-0.3125, -0.5, -0.25, 0.25, 0.5, 0.3125}, -- NodeBox4
  58. {-0.25, -0.5, -0.375, 0.1875, 0.5, 0.375}, -- NodeBox5
  59. {-0.4375, -0.5, -0.1875, 0.4375, 0.5, 0.1875}, -- NodeBox6
  60. {-0.375, -0.5, -0.25, 0.375, 0.5, 0.25}, -- NodeBox7
  61. {-0.1875, -0.5, -0.4375, 0.1875, 0.5, 0.4375}, -- NodeBox8
  62. {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5}, -- NodeBox9
  63. {-0.4375, -0.5, -0.4375, 0.4375, -0.1875, 0.4375}, -- NodeBox10
  64. {-0.375, -0.5, -0.375, 0.375, -0.0625, 0.375}, -- NodeBox11
  65. }
  66. },
  67. selection_box = {
  68. type = "fixed",
  69. fixed = {
  70. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  71. },
  72. },
  73. on_place = minetest.rotate_node,
  74. })
  75. minetest.register_craft({
  76. output = itemname .. ' 2',
  77. recipe = {
  78. {recipeitem},
  79. {recipeitem},
  80. },
  81. })
  82. end
  83. ----------
  84. -- Items
  85. ----------
  86. lapis.register_column("lapis", "lapis_block",
  87. {cracky=3},
  88. {"lapis_block.png"},
  89. "Lapis"
  90. )
  91. lapis.register_column("lapis", "lapis_brick",
  92. {cracky=3},
  93. {"lapis_brick.png"},
  94. "Lapis Brick"
  95. )
  96. lapis.register_column("lapis", "lapis_cobble",
  97. {cracky=3},
  98. {"lapis_cobble.png"},
  99. "Lapis Cobble"
  100. )
  101. lapis.register_column("lapis", "lazurite_block",
  102. {cracky= 3},
  103. {"lapis_lazurite_block.png"},
  104. "Lazurite"
  105. )
  106. lapis.register_column("lapis", "lazurite_brick",
  107. {cracky=3},
  108. {"lapis_lazurite_brick.png"},
  109. "Lazurite Brick"
  110. )