nodes.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. minetest.register_node("farming_super:pole", {
  2. description = "Farming Pole",
  3. tiles = {"default_fence_junglewood.png"},
  4. paramtype = "light",
  5. drawtype = "nodebox",
  6. node_box = {
  7. type = "connected",
  8. fixed = {-1/16, -0.5, -1/16, 1/16, 0.5, 1/16},
  9. connect_back = {{-1/32, -1/2, 0, 1/32, -15/32, 1/2 }},
  10. connect_left = {{-1/2, -1/2, -1/32, 0, -15/32, 1/32}},
  11. connect_front = {{-1/32, -1/2, -1/2, 1/32, -15/32, 0 }},
  12. connect_right = {{ 0, -1/2, -1/32, 1/2, -15/32, 1/32}},
  13. },--[[
  14. node_box = {
  15. type = "fixed",
  16. fixed = {-1/16, -0.5, -1/16, 1/16, 0.5, 1/16},
  17. },]]
  18. collision_box = {
  19. type = "fixed",
  20. fixed = {-1/16, -0.5, -1/16, 1/16, 0.5, 1/16},
  21. },
  22. connects_to = {"farming_super:wire"},
  23. sunlight_propagates = true,
  24. is_ground_content = false,
  25. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, plant = 1},
  26. sounds = default.node_sound_wood_defaults(),
  27. })
  28. minetest.register_craft({
  29. output = "farming_super:pole 1",
  30. recipe = {
  31. {"group:stick"},
  32. {"group:stick"},
  33. {"group:stick"},
  34. }
  35. })
  36. minetest.register_node("farming_super:wire", {
  37. description = "Farming Wire",
  38. tiles = {"default_fence_junglewood.png"},
  39. paramtype = "light",
  40. drawtype = "nodebox",
  41. node_box = {
  42. type = "connected",
  43. fixed = {-1/32, -1/2, -1/32, 1/32, -15/32, 1/32},
  44. connect_back = {{-1/32, -1/2, 0, 1/32, -15/32, 1/2 }},
  45. connect_left = {{-1/2, -1/2, -1/32, 0, -15/32, 1/32}},
  46. connect_front = {{-1/32, -1/2, -1/2, 1/32, -15/32, 0 }},
  47. connect_right = {{ 0, -1/2, -1/32, 1/2, -15/32, 1/32}},
  48. },
  49. collision_box = {
  50. type = "connected",
  51. -- fixed = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2},
  52. fixed = {-1/32, -1/2, -1/32, 1/32, -15/32, 1/32},
  53. connect_back = {{-1/32, -1/2, 0, 1/32, -15/32, 1/2 }},
  54. connect_left = {{-1/2, -1/2, -1/32, 0, -15/32, 1/32}},
  55. connect_front = {{-1/32, -1/2, -1/2, 1/32, -15/32, 0 }},
  56. connect_right = {{ 0, -1/2, -1/32, 1/2, -15/32, 1/32}},
  57. },
  58. selection_box = {
  59. type = "fixed",
  60. fixed = {-1/2, -1/2, -1/2, 1/2, -1/4, 1/2},
  61. },
  62. connects_to = {"farming_super:wire", "farming_super:pole"},
  63. sunlight_propagates = true,
  64. is_ground_content = false,
  65. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, },
  66. sounds = default.node_sound_wood_defaults(),
  67. })
  68. minetest.register_craft({
  69. output = "farming_super:wire 16",
  70. recipe = {
  71. {"","",""},
  72. {"","",""},
  73. {"default:tin_ingot","default:tin_ingot","default:tin_ingot"},
  74. }
  75. })
  76. minetest.register_node("farming_super:barrel", {
  77. description = "Wooden Barrel",
  78. tiles = {
  79. "default_wood.png^farming_super_barrel_bung.png",
  80. "default_wood.png",
  81. "default_wood.png^farming_super_barrel_rings.png",
  82. "default_wood.png^farming_super_barrel_rings.png",
  83. "default_wood.png^farming_super_barrel_rings.png",
  84. "default_wood.png^farming_super_barrel_rings.png"
  85. },
  86. paramtype2 = "facedir",
  87. -- inventory_image = "bitumen_oil_drum.png",
  88. groups = {
  89. cracky=2,
  90. choppy=2,
  91. oddly_breakable_by_hand=2,
  92. },
  93. paramtype = "light",
  94. drawtype = "nodebox",
  95. node_box = {
  96. type = "fixed",
  97. fixed = {
  98. --11.25
  99. {-0.49, -0.5, -0.10, 0.49, 0.5, 0.10},
  100. {-0.10, -0.5, -0.49, 0.10, 0.5, 0.49},
  101. --22.5
  102. {-0.46, -0.5, -0.19, 0.46, 0.5, 0.19},
  103. {-0.19, -0.5, -0.46, 0.19, 0.5, 0.46},
  104. -- 33.75
  105. {-0.416, -0.5, -0.28, 0.416, 0.5, 0.28},
  106. {-0.28, -0.5, -0.416, 0.28, 0.5, 0.416},
  107. --45
  108. {-0.35, -0.5, -0.35, 0.35, 0.5, 0.35},
  109. },
  110. },
  111. selection_box = {
  112. type = "fixed",
  113. fixed = {
  114. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  115. },
  116. },
  117. })
  118. minetest.register_craft({
  119. output = "farming_super:barrel 1",
  120. recipe = {
  121. {"default:wood","default:wood","default:wood"},
  122. {"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
  123. {"default:wood","default:wood","default:wood"},
  124. }
  125. })
  126. minetest.register_abm({
  127. label = "fall from vines",
  128. nodenames = {"group:hangs_from_vines"},
  129. interval = 20,
  130. chance = 10,
  131. action = function(pos, node)
  132. pos.y = pos.y + 1
  133. local wire = minetest.get_node(pos)
  134. if wire.name ~= "farming_super:wire" then
  135. pos.y = pos.y - 1
  136. minetest.set_node(pos, {name = "air"})
  137. end
  138. end,
  139. })