123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- local dye_table = dye.dyes
- for i in ipairs(dye_table) do
- local name = dye_table[i][1]
- local desc = dye_table[i][2]
- local hex = dye_table[i][3]
- minetest.register_node('furniture:curtain_short_'..name..'_0', {
- description = 'Short '..desc..' Curtain Closed',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_short.obj',
- tiles = {'furniture_curtain_short_0.png^[multiply:'..hex},
- paramtype = 'light',
- paramtype2 = 'facedir',
- drop = 'furniture:curtain_short_'..name..'_1',
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -.5, .4, .5, .5, .5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -.5, .4, .5, .5, .5},
- },
- groups = {oddly_breakable_by_hand = 3, snappy=3, not_in_creative_inventory=1},
- on_rightclick = function(pos, node)
- minetest.set_node(pos, {name='furniture:curtain_short_'..name..'_1', param2 = node.param2})
- end
- })
- minetest.register_node('furniture:curtain_short_'..name..'_1', {
- description = 'Short '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_short.obj',
- tiles = {'furniture_curtain_short_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_short_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -.5, .4, .5, .5, .5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -.5, .4, .5, .5, .5},
- },
- groups = {oddly_breakable_by_hand = 3, snappy=3},
- on_rightclick = function(pos, node)
- minetest.set_node(pos, {name='furniture:curtain_short_'..name..'_0', param2 = node.param2})
- end
- })
- minetest.register_node('furniture:curtain_tall_'..name..'_0', {
- description = 'Tall '..desc..' Curtain Closed',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_tall.obj',
- tiles = {'furniture_curtain_tall_0.png^[multiply:'..hex},
- paramtype = 'light',
- paramtype2 = 'facedir',
- drop = 'furniture:curtain_tall_'..name..'_1',
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -1.3, .4, .5, .5, .5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -1.3, .4, .5, .5, .5},
- },
- groups = {oddly_breakable_by_hand = 3, snappy=3, not_in_creative_inventory=1},
- on_rightclick = function(pos, node)
- minetest.set_node(pos, {name='furniture:curtain_tall_'..name..'_1', param2 = node.param2})
- end
- })
- minetest.register_node('furniture:curtain_tall_'..name..'_1', {
- description = 'Tall '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_tall.obj',
- tiles = {'furniture_curtain_tall_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_tall_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -1.3, .4, .5, .5, .5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -1.3, .4, .5, .5, .5},
- },
- groups = {oddly_breakable_by_hand = 3, snappy=3},
- on_rightclick = function(pos, node)
- minetest.set_node(pos, {name='furniture:curtain_tall_'..name..'_0', param2 = node.param2})
- end
- })
- end
|