nodes_fences.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. -- 22.01.13 Changed texture to that of the wood from the minimal development game
  2. local S = cottages.S
  3. minetest.register_node("cottages:fence_small", {
  4. description = S("small fence"),
  5. drawtype = "nodebox",
  6. -- top, bottom, side1, side2, inner, outer
  7. tiles = {"cottages_minimal_wood.png"},
  8. paramtype = "light",
  9. paramtype2 = "facedir",
  10. groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
  11. node_box = {
  12. type = "fixed",
  13. fixed = {
  14. { -0.45, -0.35, 0.46, 0.45, -0.20, 0.50},
  15. { -0.45, 0.00, 0.46, 0.45, 0.15, 0.50},
  16. { -0.45, 0.35, 0.46, 0.45, 0.50, 0.50},
  17. { -0.50, -0.50, 0.46, -0.45, 0.50, 0.50},
  18. { 0.45, -0.50, 0.46, 0.50, 0.50, 0.50},
  19. },
  20. },
  21. selection_box = {
  22. type = "fixed",
  23. fixed = {
  24. { -0.50, -0.50, 0.4, 0.50, 0.50, 0.5},
  25. },
  26. },
  27. is_ground_content = false,
  28. })
  29. minetest.register_node("cottages:fence_corner", {
  30. description = S("small fence corner"),
  31. drawtype = "nodebox",
  32. -- top, bottom, side1, side2, inner, outer
  33. tiles = {"cottages_minimal_wood.png"},
  34. paramtype = "light",
  35. paramtype2 = "facedir",
  36. groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
  37. node_box = {
  38. type = "fixed",
  39. fixed = {
  40. { -0.45, -0.35, 0.46, 0.45, -0.20, 0.50},
  41. { -0.45, 0.00, 0.46, 0.45, 0.15, 0.50},
  42. { -0.45, 0.35, 0.46, 0.45, 0.50, 0.50},
  43. { -0.50, -0.50, 0.46, -0.45, 0.50, 0.50},
  44. { 0.45, -0.50, 0.46, 0.50, 0.50, 0.50},
  45. { 0.46, -0.35, -0.45, 0.50, -0.20, 0.45},
  46. { 0.46, 0.00, -0.45, 0.50, 0.15, 0.45},
  47. { 0.46, 0.35, -0.45, 0.50, 0.50, 0.45},
  48. { 0.46, -0.50, -0.50, 0.50, 0.50, -0.45},
  49. { 0.46, -0.50, 0.45, 0.50, 0.50, 0.50},
  50. },
  51. },
  52. selection_box = {
  53. type = "fixed",
  54. fixed = {
  55. { -0.50, -0.50,-0.5, 0.50, 0.50, 0.5},
  56. },
  57. },
  58. is_ground_content = false,
  59. })
  60. minetest.register_node("cottages:fence_end", {
  61. description = S("small fence end"),
  62. drawtype = "nodebox",
  63. -- top, bottom, side1, side2, inner, outer
  64. tiles = {"cottages_minimal_wood.png"},
  65. paramtype = "light",
  66. paramtype2 = "facedir",
  67. groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
  68. node_box = {
  69. type = "fixed",
  70. fixed = {
  71. { -0.45, -0.35, 0.46, 0.45, -0.20, 0.50},
  72. { -0.45, 0.00, 0.46, 0.45, 0.15, 0.50},
  73. { -0.45, 0.35, 0.46, 0.45, 0.50, 0.50},
  74. { -0.50, -0.50, 0.46, -0.45, 0.50, 0.50},
  75. { 0.45, -0.50, 0.46, 0.50, 0.50, 0.50},
  76. { 0.46, -0.35, -0.45, 0.50, -0.20, 0.45},
  77. { 0.46, 0.00, -0.45, 0.50, 0.15, 0.45},
  78. { 0.46, 0.35, -0.45, 0.50, 0.50, 0.45},
  79. { 0.46, -0.50, -0.50, 0.50, 0.50, -0.45},
  80. { 0.46, -0.50, 0.45, 0.50, 0.50, 0.50},
  81. { -0.50, -0.35, -0.45, -0.46, -0.20, 0.45},
  82. { -0.50, 0.00, -0.45, -0.46, 0.15, 0.45},
  83. { -0.50, 0.35, -0.45, -0.46, 0.50, 0.45},
  84. { -0.50, -0.50, -0.50, -0.46, 0.50, -0.45},
  85. { -0.50, -0.50, 0.45, -0.46, 0.50, 0.50},
  86. },
  87. },
  88. selection_box = {
  89. type = "fixed",
  90. fixed = {
  91. { -0.50, -0.50,-0.5, 0.50, 0.50, 0.5},
  92. },
  93. },
  94. is_ground_content = false,
  95. })
  96. minetest.register_craft({
  97. output = "cottages:fence_small 3",
  98. recipe = {
  99. {cottages.craftitem_fence, cottages.craftitem_fence},
  100. }
  101. })
  102. -- xfences can be configured to replace normal fences - which makes them uncraftable
  103. if ( minetest.get_modpath("xfences") ~= nil ) then
  104. minetest.register_craft({
  105. output = "cottages:fence_small 3",
  106. recipe = {
  107. {"xfences:fence","xfences:fence" },
  108. }
  109. })
  110. end
  111. minetest.register_craft({
  112. output = "cottages:fence_corner",
  113. recipe = {
  114. {"cottages:fence_small","cottages:fence_small" },
  115. }
  116. })
  117. minetest.register_craft({
  118. output = "cottages:fence_small 2",
  119. recipe = {
  120. {"cottages:fence_corner" },
  121. }
  122. })
  123. minetest.register_craft({
  124. output = "cottages:fence_end",
  125. recipe = {
  126. {"cottages:fence_small","cottages:fence_small", "cottages:fence_small" },
  127. }
  128. })
  129. minetest.register_craft({
  130. output = "cottages:fence_small 3",
  131. recipe = {
  132. {"cottages:fence_end" },
  133. }
  134. })