misc.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. minetest.register_node('furniture:ceiling_fan', {
  2. description = 'Ceiling Fan',
  3. drawtype = 'mesh',
  4. mesh = 'furniture_ceiling_fan.obj',
  5. tiles = {'furniture_ceiling_fan.png'},
  6. paramtype = 'light',
  7. paramtype2 = 'facedir',
  8. selection_box = {
  9. type = 'fixed',
  10. fixed = {-.4, .25, -.4, .4, .5, .4},
  11. },
  12. collision_box = {
  13. type = 'fixed',
  14. fixed = {-.4, .25, -.4, .4, .5, .4},
  15. },
  16. groups = {breakable=1},
  17. })
  18. minetest.register_node('furniture:grandfather_clock', {
  19. description = 'Grandfather Clock',
  20. drawtype = 'mesh',
  21. mesh = 'furniture_grandfather_clock.obj',
  22. tiles = {'furniture_grandfather_clock.png'},
  23. use_texture_alpha = 'clip',
  24. paramtype = 'light',
  25. paramtype2 = 'facedir',
  26. selection_box = {
  27. type = 'fixed',
  28. fixed = {-.325, -.5, 0, .325, 1.4375, .4375},
  29. },
  30. collision_box = {
  31. type = 'fixed',
  32. fixed = {-.325, -.5, 0, .325, 1.4375, .4375},
  33. },
  34. groups = {breakable=1, stash=1},
  35. on_rightclick = furniture.right_click,
  36. on_punch = furniture.punch
  37. })
  38. minetest.register_node('furniture:railing_straight', {
  39. description = 'Straight Railing',
  40. drawtype = 'mesh',
  41. mesh = 'furniture_railing_straight.obj',
  42. tiles = {'furniture_railing.png'},
  43. paramtype = 'light',
  44. paramtype2 = 'facedir',
  45. selection_box = {
  46. type = 'fixed',
  47. fixed = {-.5, -.5, .4375, .5, .4375, .5625},
  48. },
  49. collision_box = {
  50. type = 'fixed',
  51. fixed = {-.5, -.5, .4375, .5, 1, .5625},
  52. },
  53. groups = {breakable=1},
  54. after_place_node = function(pos, placer)
  55. if placer:get_player_control().sneak then
  56. local node = minetest.get_node(pos)
  57. local new_pos = {x = pos.x, y = pos.y+1, z = pos.z}
  58. minetest.remove_node(pos)
  59. minetest.add_node(new_pos, {name = 'furniture:railing_straight', param2 = node.param2})
  60. end
  61. end,
  62. })
  63. minetest.register_node('furniture:railing_corner', {
  64. description = 'Corner Railing',
  65. drawtype = 'mesh',
  66. mesh = 'furniture_railing_corner.obj',
  67. tiles = {'furniture_railing.png'},
  68. paramtype = 'light',
  69. paramtype2 = 'facedir',
  70. selection_box = {
  71. type = 'fixed',
  72. fixed = {{-.5, -.5, .4375, .5, .4375, .5625},
  73. {.5625, -.5, -.5, .4375, .4375, .5625}}
  74. },
  75. collision_box = {
  76. type = 'fixed',
  77. fixed = {{-.5, -.5, .4375, .5, .4375, .5625},
  78. {.5625, -.5, -.5, .4375, .4375, .5625}}
  79. },
  80. groups = {breakable=1},
  81. after_place_node = function(pos, placer)
  82. if placer:get_player_control().sneak then
  83. local node = minetest.get_node(pos)
  84. local new_pos = {x = pos.x, y = pos.y+1, z = pos.z}
  85. minetest.remove_node(pos)
  86. minetest.add_node(new_pos, {name = 'furniture:railing_corner', param2 = node.param2})
  87. end
  88. end,
  89. })
  90. minetest.register_node('furniture:ladder', {
  91. description = 'Ladder',
  92. drawtype = 'mesh',
  93. mesh = 'furniture_ladder.obj',
  94. tiles = {'furniture_ladder.png'},
  95. paramtype = 'light',
  96. paramtype2 = 'facedir',
  97. walkable = false,
  98. climbable = true,
  99. selection_box = {
  100. type = 'fixed',
  101. fixed = {-.5, -.5, .25, .5, .5, .5}
  102. },
  103. collision_box = {
  104. type = 'fixed',
  105. fixed = {-.5, -.5, -.5, .5, .5, .5}
  106. },
  107. groups = {breakable=1},
  108. })