123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- local dye_table = furniture.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:bed1_'..name, {
- description = 'Bed with '..desc..' Blankets',
- drawtype = 'mesh',
- mesh = 'furniture_bed1.obj',
- tiles = {'furniture_bed1_wood.png', 'furniture_bed1_sheets.png'},
- overlay_tiles = {{name = '(furniture_bed1_sheets.png^[multiply:'..hex..')^furniture_bed1_mask.png', color = 'white'}},
- use_texture_alpha = 'clip',
- paramtype = 'light',
- paramtype2 = 'colorfacedir',
- palette = 'furniture_stain_palette.png',
- selection_box = {
- type = 'fixed',
- fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
- {-.5, 0, 1.35, .5, .5, 1.5}}
- },
- collision_box = {
- type = 'fixed',
- fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
- {-.5, 0, 1.35, .5, .5, 1.5}}
- },
- groups = {breakable=1},
- on_rightclick = furniture.right_click,
- on_punch = furniture.punch
- })
- minetest.register_node('furniture:bed_double1_'..name, {
- description = 'Double Bed with '..desc..' Blankets',
- drawtype = 'mesh',
- mesh = 'furniture_bed_double1.obj',
- tiles = {'furniture_bed_double1_wood.png', 'furniture_bed_double1_sheets.png'},
- overlay_tiles = {{name = '(furniture_bed_double1_sheets.png^[multiply:'..hex..')^furniture_bed_double1_mask.png', color = 'white'}},
- use_texture_alpha = 'clip',
- paramtype = 'light',
- paramtype2 = 'colorfacedir',
- palette = 'furniture_stain_palette.png',
- selection_box = {
- type = 'fixed',
- fixed = {{-.5, -.5, -.5, 1.5, 0, 1.5},
- {-.5, 0, 1.35, 1.5, .5, 1.5}}
- },
- collision_box = {
- type = 'fixed',
- fixed = {{-.5, -.5, -.5, 1.5, 0, 1.5},
- {-.5, 0, 1.35, 1.5, .5, 1.5}}
- },
- groups = {breakable=1},
- on_rightclick = furniture.right_click,
- on_punch = furniture.punch
- })
- end
- minetest.register_node('furniture:sleeping_mat', {
- description = 'Sleeping Mat',
- drawtype = 'mesh',
- mesh = 'furniture_sleeping_mat.obj',
- tiles = {'furniture_sleeping_mat.png'},
- paramtype = 'light',
- paramtype2 = 'facedir',
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.5, .5, -.25, 1.5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.5, .5, -.25, 1.5},
- },
- groups = {breakable=1}
- })
- minetest.register_node('furniture:nightstand_1', {
- description = 'Nightstand',
- drawtype = 'mesh',
- mesh = 'furniture_nightstand_1.obj',
- tiles = {'furniture_nightstand_1.png'},
- paramtype = 'light',
- paramtype2 = 'colorfacedir',
- palette = 'furniture_stain_palette.png',
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.25, .5, .5, .5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.25, .5, .5, .5},
- },
- groups = {breakable=1, stash=1},
- on_rightclick = furniture.right_click,
- on_punch = furniture.punch
- })
- minetest.register_node('furniture:dresser1_wide', {
- description = 'Wide Dresser',
- drawtype = 'mesh',
- mesh = 'furniture_dresser1_wide.obj',
- tiles = {'furniture_dresser1_wide.png'},
- paramtype = 'light',
- paramtype2 = 'colorfacedir',
- palette = 'furniture_stain_palette.png',
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.375, 1.5, .5, .5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.375, 1.5, .5, .5},
- },
- groups = {breakable=1, stash=1},
- on_rightclick = furniture.right_click,
- on_punch = furniture.punch
- })
- minetest.register_node('furniture:dresser1_tall', {
- description = 'Tall Dresser',
- drawtype = 'mesh',
- mesh = 'furniture_dresser1_tall.obj',
- tiles = {'furniture_dresser1_tall.png'},
- paramtype = 'light',
- paramtype2 = 'colorfacedir',
- palette = 'furniture_stain_palette.png',
- selection_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.375, .5, 1.5, .5},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.5, -.5, -.375, .5, 1.5, .5},
- },
- groups = {breakable=1, stash=1},
- on_rightclick = furniture.right_click,
- on_punch = furniture.punch
- })
|