minetest.register_node('furniture:ceiling_fan', {
   description = 'Ceiling Fan',
   drawtype = 'mesh',
   mesh = 'furniture_ceiling_fan.obj',
   tiles = {'furniture_ceiling_fan.png'},
   paramtype = 'light',
   paramtype2 = 'facedir',
   selection_box = {
      type = 'fixed',
      fixed = {-.4, .25, -.4, .4, .5, .4},
      },
   collision_box = {
      type = 'fixed',
      fixed = {-.4, .25, -.4, .4, .5, .4},
      },
   groups = {breakable=1},
})

minetest.register_node('furniture:grandfather_clock', {
   description = 'Grandfather Clock',
   drawtype = 'mesh',
   mesh = 'furniture_grandfather_clock.obj',
   tiles = {'furniture_grandfather_clock.png'},
   use_texture_alpha = 'clip',
   paramtype = 'light',
   paramtype2 = 'facedir',
   selection_box = {
      type = 'fixed',
      fixed = {-.325, -.5, 0, .325, 1.4375, .4375},
      },
   collision_box = {
      type = 'fixed',
      fixed = {-.325, -.5, 0, .325, 1.4375, .4375},
      },
   groups = {breakable=1, stash=1},
   on_rightclick = furniture.right_click,
   on_punch = furniture.punch
})

minetest.register_node('furniture:railing_straight', {
   description = 'Straight Railing',
   drawtype = 'mesh',
   mesh = 'furniture_railing_straight.obj',
   tiles = {'furniture_railing.png'},
   paramtype = 'light',
   paramtype2 = 'facedir',
   selection_box = {
      type = 'fixed',
      fixed = {-.5, -.5, .4375, .5, .4375, .5625},
      },
   collision_box = {
      type = 'fixed',
      fixed = {-.5, -.5, .4375, .5, 1, .5625},
      },
   groups = {breakable=1},
   after_place_node = function(pos, placer)
      if placer:get_player_control().sneak then
         local node = minetest.get_node(pos)
         local new_pos = {x = pos.x, y = pos.y+1, z = pos.z}
         minetest.remove_node(pos)
         minetest.add_node(new_pos, {name = 'furniture:railing_straight', param2 = node.param2})
      end
   end,
})

minetest.register_node('furniture:railing_corner', {
   description = 'Corner Railing',
   drawtype = 'mesh',
   mesh = 'furniture_railing_corner.obj',
   tiles = {'furniture_railing.png'},
   paramtype = 'light',
   paramtype2 = 'facedir',
   selection_box = {
      type = 'fixed',
      fixed = {{-.5, -.5, .4375, .5, .4375, .5625},
               {.5625, -.5, -.5, .4375, .4375, .5625}}
      },
   collision_box = {
      type = 'fixed',
      fixed = {{-.5, -.5, .4375, .5, .4375, .5625},
               {.5625, -.5, -.5, .4375, .4375, .5625}}
      },
   groups = {breakable=1},
   after_place_node = function(pos, placer)
      if placer:get_player_control().sneak then
         local node = minetest.get_node(pos)
         local new_pos = {x = pos.x, y = pos.y+1, z = pos.z}
         minetest.remove_node(pos)
         minetest.add_node(new_pos, {name = 'furniture:railing_corner', param2 = node.param2})
      end
   end,
})
