decor.lua 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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:curtain_short_'..name..'_0', {
  7. description = 'Short '..desc..' Curtain Closed',
  8. drawtype = 'mesh',
  9. mesh = 'furniture_curtain_short.obj',
  10. tiles = {'furniture_curtain_short_0.png^[multiply:'..hex},
  11. paramtype = 'light',
  12. paramtype2 = 'facedir',
  13. drop = 'furniture:curtain_short_'..name..'_1',
  14. selection_box = {
  15. type = 'fixed',
  16. fixed = {-.5, -.5, .4, .5, .5, .5},
  17. },
  18. collision_box = {
  19. type = 'fixed',
  20. fixed = {-.5, -.5, .4, .5, .5, .5},
  21. },
  22. groups = {oddly_breakable_by_hand = 3, snappy=3, not_in_creative_inventory=1},
  23. on_rightclick = function(pos, node)
  24. minetest.set_node(pos, {name='furniture:curtain_short_'..name..'_1', param2 = node.param2})
  25. end
  26. })
  27. minetest.register_node('furniture:curtain_short_'..name..'_1', {
  28. description = 'Short '..desc..' Curtain Open',
  29. drawtype = 'mesh',
  30. mesh = 'furniture_curtain_short.obj',
  31. tiles = {'furniture_curtain_short_1.png^[multiply:'..hex},
  32. inventory_image = 'furniture_curtain_short_1.png^[multiply:'..hex,
  33. paramtype = 'light',
  34. paramtype2 = 'facedir',
  35. sunlight_propagates = true,
  36. selection_box = {
  37. type = 'fixed',
  38. fixed = {-.5, -.5, .4, .5, .5, .5},
  39. },
  40. collision_box = {
  41. type = 'fixed',
  42. fixed = {-.5, -.5, .4, .5, .5, .5},
  43. },
  44. groups = {oddly_breakable_by_hand = 3, snappy=3},
  45. on_rightclick = function(pos, node)
  46. minetest.set_node(pos, {name='furniture:curtain_short_'..name..'_0', param2 = node.param2})
  47. end
  48. })
  49. minetest.register_node('furniture:curtain_tall_'..name..'_0', {
  50. description = 'Tall '..desc..' Curtain Closed',
  51. drawtype = 'mesh',
  52. mesh = 'furniture_curtain_tall.obj',
  53. tiles = {'furniture_curtain_tall_0.png^[multiply:'..hex},
  54. paramtype = 'light',
  55. paramtype2 = 'facedir',
  56. drop = 'furniture:curtain_tall_'..name..'_1',
  57. selection_box = {
  58. type = 'fixed',
  59. fixed = {-.5, -1.3, .4, .5, .5, .5},
  60. },
  61. collision_box = {
  62. type = 'fixed',
  63. fixed = {-.5, -1.3, .4, .5, .5, .5},
  64. },
  65. groups = {oddly_breakable_by_hand = 3, snappy=3, not_in_creative_inventory=1},
  66. on_rightclick = function(pos, node)
  67. minetest.set_node(pos, {name='furniture:curtain_tall_'..name..'_1', param2 = node.param2})
  68. end
  69. })
  70. minetest.register_node('furniture:curtain_tall_'..name..'_1', {
  71. description = 'Tall '..desc..' Curtain Open',
  72. drawtype = 'mesh',
  73. mesh = 'furniture_curtain_tall.obj',
  74. tiles = {'furniture_curtain_tall_1.png^[multiply:'..hex},
  75. inventory_image = 'furniture_curtain_tall_1.png^[multiply:'..hex,
  76. paramtype = 'light',
  77. paramtype2 = 'facedir',
  78. sunlight_propagates = true,
  79. selection_box = {
  80. type = 'fixed',
  81. fixed = {-.5, -1.3, .4, .5, .5, .5},
  82. },
  83. collision_box = {
  84. type = 'fixed',
  85. fixed = {-.5, -1.3, .4, .5, .5, .5},
  86. },
  87. groups = {oddly_breakable_by_hand = 3, snappy=3},
  88. on_rightclick = function(pos, node)
  89. minetest.set_node(pos, {name='furniture:curtain_tall_'..name..'_0', param2 = node.param2})
  90. end
  91. })
  92. end