123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608 |
- fdir_table = {
- { 1, 0 },
- { 0, -1 },
- { -1, 0 },
- { 0, 1 },
- { 1, 0 },
- { 0, -1 },
- { -1, 0 },
- { 0, 1 },
- }
- function furniture.curtain_placement(pos)
- local node = minetest.get_node(pos)
- local nodename = node.name
- local fdir = node.param2
- local posr = {x = pos.x + fdir_table[fdir+1][1], y=pos.y, z = pos.z + fdir_table[fdir+1][2]}
- local posl = {x = pos.x - fdir_table[fdir+1][1], y=pos.y, z = pos.z - fdir_table[fdir+1][2]}
- local noder = minetest.get_node(posr)
- local nodel = minetest.get_node(posl)
- local nodername = noder.name
- local nodelname = nodel.name
- local height = string.sub(nodename, 19, 19)
- local part = string.sub(nodename, 20, 20)
- local color = string.sub(nodename, 22, -3)
- local rheight = string.sub(nodername, 19, 19)
- local rpart = string.sub(nodername, 20, 20)
- local rcolor = string.sub(nodername, 22, -3)
- local lheight = string.sub(nodelname, 19, 19)
- local lpart = string.sub(nodelname, 20, 20)
- local lcolor = string.sub(nodelname, 22, -3)
- if lheight == height and lcolor == color then --placing to the right
- minetest.set_node(pos,{name = 'furniture:curtain_'..height..'r_'..color..'_1', param2=fdir})
- if lpart == 'r' then
- minetest.set_node(posl,{name = 'furniture:curtain_'..height..'c_'..color..'_1', param2=fdir})
- elseif lpart == 's' then
- minetest.set_node(posl,{name = 'furniture:curtain_'..height..'l_'..color..'_1', param2=fdir})
- end
- end
- if rheight == height and rcolor == color then --placing to the left
- minetest.set_node(pos,{name = 'furniture:curtain_'..height..'l_'..color..'_1', param2=fdir})
- if rpart == 'l' then
- minetest.set_node(posr,{name = 'furniture:curtain_'..height..'c_'..color..'_1', param2=fdir})
- elseif rpart == 's' then
- minetest.set_node(posr,{name = 'furniture:curtain_'..height..'r_'..color..'_1', param2=fdir})
- end
- end
- end
- function furniture.curtain_removal(pos, node, digger)
- local nodename = node.name
- local fdir = node.param2
- local posr = {x = pos.x + fdir_table[fdir+1][1], y=pos.y, z = pos.z + fdir_table[fdir+1][2]}
- local posl = {x = pos.x - fdir_table[fdir+1][1], y=pos.y, z = pos.z - fdir_table[fdir+1][2]}
- local noder = minetest.get_node(posr)
- local nodel = minetest.get_node(posl)
- local nodername = noder.name
- local nodelname = nodel.name
- local height = string.sub(nodename, 19, 19)
- local part = string.sub(nodename, 20, 20)
- local color = string.sub(nodename, 22, -3)
- local rheight = string.sub(nodername, 19, 19)
- local rpart = string.sub(nodername, 20, 20)
- local rcolor = string.sub(nodername, 22, -3)
- local lheight = string.sub(nodelname, 19, 19)
- local lpart = string.sub(nodelname, 20, 20)
- local lcolor = string.sub(nodelname, 22, -3)
- minetest.remove_node(pos)
- local player_inv = digger:get_inventory()
- if player_inv:room_for_item('main', 'furniture:curtain_'..height..'s_'..color..'_1') then
- player_inv:add_item('main', 'furniture:curtain_'..height..'s_'..color..'_1')
- else
- local drop_pos = digger:get_pos()
- minetest.add_item(drop_pos, 'furniture:curtain_'..height..'s_'..color..'_1')
- end
- if lheight == height and lcolor == color then --node to the left
- if lpart == 'c' then
- minetest.set_node(posl,{name = 'furniture:curtain_'..height..'r_'..color..'_1', param2=nodel.param2})
- elseif lpart == 'l' then
- minetest.set_node(posl,{name = 'furniture:curtain_'..height..'s_'..color..'_1', param2=nodel.param2})
- end
- end
- if rheight == height and rcolor == color then --node to the right
- if rpart == 'c' then
- minetest.set_node(posr,{name = 'furniture:curtain_'..height..'l_'..color..'_1', param2=noder.param2})
- elseif rpart == 'r' then
- minetest.set_node(posr,{name = 'furniture:curtain_'..height..'s_'..color..'_1', param2=noder.param2})
- end
- end
- end
- function furniture.curtain_toggle(pos, node)
- local nodename = node.name
- local height = string.sub(nodename, 19, 19)
- local part = string.sub(nodename, 20, 20)
- local color = string.sub(nodename, 22, -3)
- local state = string.sub(nodename, -1, -1)
- local new_state = math.abs(state - 1) --if state is zero, subtracting 1 makes it negative one, and the absolute value of negative one is one.
- local fdir = node.param2
- local curtain = color..'_'..height
- if fdir == 0 then --Search in the X axis
- local next_pos = {x=pos.x-1, y=pos.y, z=pos.z}
- local next_node = minetest.get_node(next_pos).name
- local next_color = string.sub(next_node, 22, -3)
- local next_height = string.sub(next_node, 19, 19)
- local next_part = string.sub(next_node, 20, 20)
- local next_curtain = next_color..'_'..next_height
- minetest.set_node(pos, {name='furniture:curtain_'..height..part..'_'..color..'_'..new_state, param2 = fdir})
- while next_curtain == curtain do
- minetest.set_node(next_pos, {name='furniture:curtain_'..height..next_part..'_'..color..'_'..new_state, param2 = fdir})
- next_pos.x = next_pos.x - 1
- next_node = minetest.get_node(next_pos).name
- next_color = string.sub(next_node, 22, -3)
- next_height = string.sub(next_node, 19, 19)
- next_part = string.sub(next_node, 20, 20)
- next_curtain = next_color..'_'..next_height
- end
- elseif fdir == 2 then --Search in the X axis
- local next_pos = {x=pos.x+1, y=pos.y, z=pos.z}
- local next_node = minetest.get_node(next_pos).name
- local next_color = string.sub(next_node, 22, -3)
- local next_height = string.sub(next_node, 19, 19)
- local next_part = string.sub(next_node, 20, 20)
- local next_curtain = next_color..'_'..next_height
- minetest.set_node(pos, {name='furniture:curtain_'..height..part..'_'..color..'_'..new_state, param2 = fdir})
- while next_curtain == curtain do
- minetest.set_node(next_pos, {name='furniture:curtain_'..height..next_part..'_'..color..'_'..new_state, param2 = fdir})
- next_pos.x = next_pos.x + 1
- next_node = minetest.get_node(next_pos).name
- next_color = string.sub(next_node, 22, -3)
- next_height = string.sub(next_node, 19, 19)
- next_part = string.sub(next_node, 20, 20)
- next_curtain = next_color..'_'..next_height
- end
- elseif fdir == 1 then --Search in the Z axis
- local next_pos = {x=pos.x, y=pos.y, z=pos.z+1}
- local next_node = minetest.get_node(next_pos).name
- local next_color = string.sub(next_node, 22, -3)
- local next_height = string.sub(next_node, 19, 19)
- local next_part = string.sub(next_node, 20, 20)
- local next_curtain = next_color..'_'..next_height
- minetest.set_node(pos, {name='furniture:curtain_'..height..part..'_'..color..'_'..new_state, param2 = fdir})
- while next_curtain == curtain do
- minetest.set_node(next_pos, {name='furniture:curtain_'..height..next_part..'_'..color..'_'..new_state, param2 = fdir})
- next_pos.z = next_pos.z + 1
- next_node = minetest.get_node(next_pos).name
- next_color = string.sub(next_node, 22, -3)
- next_height = string.sub(next_node, 19, 19)
- next_part = string.sub(next_node, 20, 20)
- next_curtain = next_color..'_'..next_height
- end
- elseif fdir == 3 then --Search in the Z axis
- local next_pos = {x=pos.x, y=pos.y, z=pos.z-1}
- local next_node = minetest.get_node(next_pos).name
- local next_color = string.sub(next_node, 22, -3)
- local next_height = string.sub(next_node, 19, 19)
- local next_part = string.sub(next_node, 20, 20)
- local next_curtain = next_color..'_'..next_height
- minetest.set_node(pos, {name='furniture:curtain_'..height..part..'_'..color..'_'..new_state, param2 = fdir})
- while next_curtain == curtain do
- minetest.set_node(next_pos, {name='furniture:curtain_'..height..next_part..'_'..color..'_'..new_state, param2 = fdir})
- next_pos.z = next_pos.z - 1
- next_node = minetest.get_node(next_pos).name
- next_color = string.sub(next_node, 22, -3)
- next_height = string.sub(next_node, 19, 19)
- next_part = string.sub(next_node, 20, 20)
- next_curtain = next_color..'_'..next_height
- end
- end
- end
- 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_ss_'..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_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- after_place_node = function(pos, placer, itemstack)
- furniture.curtain_placement(pos)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_sl_'..name..'_0', {
- description = 'Short Left '..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_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_sl_'..name..'_1', {
- description = 'Short Left '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_short.obj',
- tiles = {'furniture_curtain_sl_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_sl_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- drop = 'furniture:curtain_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_sr_'..name..'_0', {
- description = 'Short Right '..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_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_sr_'..name..'_1', {
- description = 'Short Right '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_short.obj',
- tiles = {'furniture_curtain_sr_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_sr_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- drop = 'furniture:curtain_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_sc_'..name..'_0', {
- description = 'Short Middle '..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_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_sc_'..name..'_1', {
- description = 'Short Middle '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_short.obj',
- tiles = {'furniture_curtain_sc_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_sc_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- drop = 'furniture:curtain_ss_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_ts_'..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, -.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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_ts_'..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, -.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)
- furniture.curtain_toggle(pos, node)
- end,
- after_place_node = function(pos, placer, itemstack)
- furniture.curtain_placement(pos)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_tl_'..name..'_0', {
- description = 'Tall Left '..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_tl_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_tl_'..name..'_1', {
- description = 'Tall Left '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_tall.obj',
- tiles = {'furniture_curtain_tl_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_tl_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- drop = 'furniture:curtain_tl_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_tr_'..name..'_0', {
- description = 'Tall Right '..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_tl_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_tr_'..name..'_1', {
- description = 'Tall Right '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_tall.obj',
- tiles = {'furniture_curtain_tr_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_tr_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- drop = 'furniture:curtain_tl_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_tc_'..name..'_0', {
- description = 'Tall Middle '..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_tl_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- minetest.register_node('furniture:curtain_tc_'..name..'_1', {
- description = 'Tall Middle '..desc..' Curtain Open',
- drawtype = 'mesh',
- mesh = 'furniture_curtain_tall.obj',
- tiles = {'furniture_curtain_tc_1.png^[multiply:'..hex},
- inventory_image = 'furniture_curtain_tc_1.png^[multiply:'..hex,
- paramtype = 'light',
- paramtype2 = 'facedir',
- sunlight_propagates = true,
- drop = 'furniture:curtain_tl_'..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)
- furniture.curtain_toggle(pos, node)
- end,
- on_dig = function(pos, node, digger)
- furniture.curtain_removal(pos, node, digger)
- end
- })
- end
|