outdoors.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. minetest.register_node('furniture:traffic_barrel', {
  2. description = 'Traffic Barrel',
  3. drawtype = 'mesh',
  4. mesh = 'furniture_traffic_barrel.obj',
  5. tiles = {'furniture_traffic_barrel.png'},
  6. paramtype = 'light',
  7. paramtype2 = 'facedir',
  8. selection_box = {
  9. type = 'fixed',
  10. fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
  11. },
  12. collision_box = {
  13. type = 'fixed',
  14. fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
  15. },
  16. groups = {breakable=1},
  17. })
  18. minetest.register_node('furniture:traffic_barricade', {
  19. description = 'Traffic Barricade',
  20. drawtype = 'mesh',
  21. mesh = 'furniture_traffic_barricade.obj',
  22. tiles = {'furniture_traffic_barricade.png'},
  23. paramtype = 'light',
  24. paramtype2 = 'facedir',
  25. selection_box = {
  26. type = 'fixed',
  27. fixed = {-.5, -.5, -.125, 1.5, .5, .125},
  28. },
  29. collision_box = {
  30. type = 'fixed',
  31. fixed = {-.5, -.5, -.125, 1.5, 1, .125},
  32. },
  33. groups = {breakable=1},
  34. })
  35. minetest.register_node('furniture:fire_hydrant', {
  36. description = 'Fire Hydrant',
  37. drawtype = 'mesh',
  38. mesh = 'furniture_fire_hydrant.obj',
  39. tiles = {'furniture_fire_hydrant.png'},
  40. paramtype = 'light',
  41. paramtype2 = 'facedir',
  42. selection_box = {
  43. type = 'fixed',
  44. fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
  45. },
  46. collision_box = {
  47. type = 'fixed',
  48. fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
  49. },
  50. groups = {breakable=1},
  51. after_place_node = function(pos)
  52. local under_node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
  53. if minetest.get_item_group(under_node, 'slab') > 0 then
  54. local node = minetest.get_node(pos)
  55. minetest.set_node(pos, {name = 'furniture:fire_hydrant_1', param2 = node.param2})
  56. end
  57. end,
  58. })
  59. minetest.register_node('furniture:fire_hydrant_1', {
  60. description = 'Fire Hydrant',
  61. drawtype = 'mesh',
  62. mesh = 'furniture_fire_hydrant_1.obj',
  63. tiles = {'furniture_fire_hydrant.png'},
  64. paramtype = 'light',
  65. paramtype2 = 'facedir',
  66. drop = 'furniture:fire_hydrant',
  67. selection_box = {
  68. type = 'fixed',
  69. fixed = {-.3125, -1, -.3125, .3125, 0, .3125},
  70. },
  71. collision_box = {
  72. type = 'fixed',
  73. fixed = {-.3125, -1, -.3125, .3125, 0, .3125},
  74. },
  75. groups = {breakable=1, not_in_creative_inventory=1},
  76. })
  77. minetest.register_node('furniture:parking_bumper', {
  78. description = 'Parking Bumper',
  79. drawtype = 'mesh',
  80. mesh = 'furniture_parking_bumper.obj',
  81. tiles = {'furniture_parking_bumper.png'},
  82. paramtype = 'light',
  83. paramtype2 = 'facedir',
  84. selection_box = {
  85. type = 'fixed',
  86. fixed = {-.375, -.5, .125, 1.375, -.3125, .375},
  87. },
  88. collision_box = {
  89. type = 'fixed',
  90. fixed = {-.375, -.5, .125, 1.375, -.3125, .375},
  91. },
  92. groups = {breakable=1},
  93. })
  94. minetest.register_node('furniture:bollard_popup_0', { --Closed
  95. description = 'Popup Bollard',
  96. drawtype = 'mesh',
  97. mesh = 'furniture_popup_bollard_down.obj',
  98. tiles = {'furniture_popup_bollard_down.png'},
  99. paramtype = 'light',
  100. paramtype2 = 'facedir',
  101. drop = 'furniture:bollard_popup_1',
  102. selection_box = {
  103. type = 'fixed',
  104. fixed = {-.5, -.5, -.1875, .5, -.375, .1875},
  105. },
  106. collision_box = {
  107. type = 'fixed',
  108. fixed = {-.5, -.5, -.1875, .5, -.375, .1875},
  109. },
  110. groups = {breakable=1, not_in_creative_inventory=1},
  111. on_rightclick = function(pos, node, clicker)
  112. local player_name = clicker:get_player_name()
  113. if not minetest.is_protected(pos, player_name) and minetest.check_player_privs(player_name, { creative = true }) then
  114. local node = minetest.get_node(pos)
  115. minetest.set_node(pos, {name = 'furniture:bollard_popup_1', param2 = node.param2})
  116. end
  117. end
  118. })
  119. minetest.register_node('furniture:bollard_popup_1', { --Open
  120. description = 'Popup Bollard',
  121. drawtype = 'mesh',
  122. mesh = 'furniture_popup_bollard_up.obj',
  123. tiles = {'furniture_popup_bollard_up.png'},
  124. paramtype = 'light',
  125. paramtype2 = 'facedir',
  126. selection_box = {
  127. type = 'fixed',
  128. fixed = {{-.5, -.5, -.1875, .5, -.375, .1875},
  129. {-.125, -.375, -.125, .125, .5, .125}}
  130. },
  131. collision_box = {
  132. type = 'fixed',
  133. fixed = {-.5, -.5, -.1875, .5, 1, .1875},
  134. },
  135. groups = {breakable=1},
  136. on_rightclick = function(pos, node, clicker)
  137. local player_name = clicker:get_player_name()
  138. if not minetest.is_protected(pos, player_name) and minetest.check_player_privs(player_name, { creative = true }) then
  139. local node = minetest.get_node(pos)
  140. minetest.set_node(pos, {name = 'furniture:bollard_popup_0', param2 = node.param2})
  141. end
  142. end
  143. })
  144. minetest.register_node('furniture:well', {
  145. description = 'Well',
  146. drawtype = 'mesh',
  147. mesh = 'furniture_well.obj',
  148. tiles = {'furniture_well.png'},
  149. paramtype = 'light',
  150. paramtype2 = 'facedir',
  151. selection_box = {
  152. type = 'fixed',
  153. fixed = {{-.6875, -.5, .5, .6875, .125, .6875},
  154. {.5, -.5, -.6875, .6875, .125, .6875},
  155. {-.6875, -.5, -.6875, -.5, .125, .6875},
  156. {-.6875, -.5, -.6875, .6875, .125, -.5},
  157. {-.6875, .75, -.9375, .6875, 1.375, .9375}}
  158. },
  159. collision_box = {
  160. type = 'fixed',
  161. fixed = {{-.6875, -.5, .5, .6875, .125, .6875},
  162. {.5, -.5, -.6875, .6875, .125, .6875},
  163. {-.6875, -.5, -.6875, -.5, .125, .6875},
  164. {-.6875, -.5, -.6875, .6875, .125, -.5},
  165. {-.6875, .75, -.9375, .6875, 1.375, .9375}}
  166. },
  167. groups = {breakable=1},
  168. after_place_node = function(pos, placer, itemstack, pointed_thing)
  169. if pointed_thing.above.y == pointed_thing.under.y then
  170. minetest.remove_node(pos)
  171. local new_pos = {x=pos.x, y=pos.y+1, z=pos.z}
  172. local node = minetest.get_node(pos)
  173. minetest.add_node(new_pos, {name='furniture:well', param2=node.param2})
  174. end
  175. end,
  176. })
  177. minetest.register_node('furniture:trash_bin', {
  178. description = 'Trash Bin',
  179. drawtype = 'mesh',
  180. mesh = 'furniture_trash_bin.obj',
  181. tiles = {'furniture_trash_bin.png'},
  182. paramtype = 'light',
  183. paramtype2 = 'facedir',
  184. selection_box = {
  185. type = 'fixed',
  186. fixed = {-.375, -.5, -.375, .375, .5, .375},
  187. },
  188. collision_box = {
  189. type = 'fixed',
  190. fixed = {-.375, -.5, -.375, .375, .5, .375},
  191. },
  192. groups = {breakable=1, stash=1}
  193. })
  194. minetest.register_node('furniture:recycling_bin', {
  195. description = 'Recycling Bin',
  196. drawtype = 'mesh',
  197. mesh = 'furniture_recycling_bin.obj',
  198. tiles = {'furniture_recycling_bin.png'},
  199. paramtype = 'light',
  200. paramtype2 = 'facedir',
  201. selection_box = {
  202. type = 'fixed',
  203. fixed = {{-.375, -.5, -.375, .375, .5, .375},
  204. {-.4375, .25, -.4375, .4375, .6875, .4375}
  205. },
  206. },
  207. collision_box = {
  208. type = 'fixed',
  209. fixed = {{-.375, -.5, -.375, .375, .5, .375},
  210. {-.4375, .25, -.4375, .4375, .6875, .4375}
  211. },
  212. },
  213. groups = {breakable=1, stash=1}
  214. })
  215. minetest.register_node('furniture:dumpster', {
  216. description = 'Dumpster',
  217. drawtype = 'mesh',
  218. mesh = 'furniture_dumpster.obj',
  219. tiles = {'furniture_dumpster.png'},
  220. paramtype = 'light',
  221. paramtype2 = 'facedir',
  222. selection_box = {
  223. type = 'fixed',
  224. fixed = {-.5, -.5, -.5, 1.5, .75, .5},
  225. },
  226. collision_box = {
  227. type = 'fixed',
  228. fixed = {-.5, -.5, -.5, 1.5, .75, .5},
  229. },
  230. groups = {breakable=1, stash=1}
  231. })