bedroom.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. local dye_table = dye.dyes
  2. for i in ipairs(dye_table) do
  3. local name = dye_table[i][1]
  4. local desc = dye_table[i][2]
  5. local hex = dye_table[i][3]
  6. minetest.register_node('furniture:bed1_'..name, {
  7. _doc_items_crafting = 'This is crafted in the Woodworking Station.',
  8. description = 'Bed with '..desc..' Blankets',
  9. drawtype = 'mesh',
  10. mesh = 'furniture_bed1.obj',
  11. tiles = {'furniture_bed1_wood.png', 'furniture_bed1_sheets.png'},
  12. overlay_tiles = {{name = '(furniture_bed1_sheets.png^[multiply:'..hex..')^furniture_bed1_mask.png', color = 'white'}},
  13. paramtype = 'light',
  14. paramtype2 = 'colorfacedir',
  15. palette = 'furniture_stain_palette.png',
  16. selection_box = {
  17. type = 'fixed',
  18. fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
  19. {-.5, 0, 1.35, .5, .5, 1.5}}
  20. },
  21. collision_box = {
  22. type = 'fixed',
  23. fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
  24. {-.5, 0, 1.35, .5, .5, 1.5}}
  25. },
  26. groups = {oddly_breakable_by_hand = 2, choppy=3, stainable=1},
  27. after_place_node = function(pos, placer, itemstack)
  28. if not epic.space_to_front(pos) then
  29. minetest.remove_node(pos)
  30. return itemstack
  31. end
  32. end,
  33. after_dig_node = function(pos, oldnode)
  34. epic.remove_front_node(pos, oldnode)
  35. end,
  36. on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
  37. beds.on_rightclick(pos, clicker)
  38. return itemstack
  39. end,
  40. on_rotate = function(pos, node)
  41. return false
  42. end,
  43. })
  44. end