1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 08:20:21 +01:00

add bed, wardrobe and pool table

This commit is contained in:
Vanessa Ezekowitz 2014-08-07 14:49:26 -04:00
parent d652a47f69
commit 075a6195dc
36 changed files with 422 additions and 1 deletions

View File

@ -2298,3 +2298,30 @@ minetest.register_craft( {
{"farming:wheat", "farming:wheat", "farming:wheat"} {"farming:wheat", "farming:wheat", "farming:wheat"}
}, },
}) })
minetest.register_craft( {
output = "homedecor:wardrobe_bottom",
recipe = {
{ "homedecor:drawer_small", "homedecor:kitchen_cabinet" },
{ "homedecor:drawer_small", "default:wood" },
{ "homedecor:drawer_small", "default:wood" }
},
})
minetest.register_craft( {
output = "homedecor:bed_blue_foot",
recipe = {
{ "group:stick", "", "group:stick" },
{ "wool:white", "wool:blue", "wool:blue" },
{ "group:wood", "", "group:wood" },
},
})
minetest.register_craft( {
output = "homedecor:pool_table",
recipe = {
{ "wool:dark_green", "wool:dark_green", "wool:dark_green" },
{ "group:wood", "group:wood", "group:wood" },
{ "group:stick", "", "group:stick" }
},
})

View File

@ -240,7 +240,261 @@ minetest.register_node(":homedecor:openframe_bookshelf", {
} }
}) })
-- decorative bed and wardrobe, models by jp
minetest.register_node("homedecor:bed_blue_head", {
tiles = {
"homedecor_bed_blue_top1.png",
"homedecor_bed_bottom1.png",
"homedecor_bed_blue_side1.png",
"homedecor_bed_blue_side1.png^[transformFX",
"homedecor_bed_blue_head1.png",
"homedecor_bed_blue_head2.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.4375, -0.375, 0.5, 0.5}, -- NodeBox1
{0.375, -0.5, 0.4375, 0.5, 0.5, 0.5}, -- NodeBox2
{-0.5, 0.25, 0.4375, 0.5, 0.4375, 0.5}, -- NodeBox3
{-0.5, 0, 0.4375, 0.5, 0.1875, 0.5}, -- NodeBox4
{-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5}, -- NodeBox5
{-0.4375, -0.375, -0.5, -0.375, -0.125, 0.5}, -- NodeBox6
{0.375, -0.375, -0.5, 0.4375, -0.125, 0.5}, -- NodeBox7
{-0.375, -0.375, 0.25, 0.375, -0.3125, 0.375}, -- NodeBox8
{-0.375, -0.375, 0.0625, 0.375, -0.3125, 0.1875}, -- NodeBox9
{-0.375, -0.375, -0.125, 0.375, -0.3125, 0}, -- NodeBox10
{-0.375, -0.375, -0.3125, 0.375, -0.3125, -0.1875}, -- NodeBox11
{-0.375, -0.375, -0.5, 0.375, -0.3125, -0.375}, -- NodeBox12
{-0.375, -0.3125, -0.5, 0.375, -0.0625, 0.4375}, -- NodeBox13
{-0.3125, -0.125, 0.0625, 0.3125, 0.0625, 0.4375}, -- NodeBox14
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
}
})
local fdir_to_fwd = {
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
}
minetest.register_node("homedecor:bed_blue_foot", {
tiles = {
"homedecor_bed_blue_top2.png",
"homedecor_bed_bottom2.png",
"homedecor_bed_blue_side2.png",
"homedecor_bed_blue_side2.png^[transformFX",
"homedecor_bed_blue_foot2.png",
"homedecor_bed_blue_foot1.png"
},
inventory_image = "homedecor_bed_blue_inv.png",
description = "Bed",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, -0.375, 0.1875, -0.4375}, -- NodeBox1
{0.375, -0.5, -0.5, 0.5, 0.1875, -0.4375}, -- NodeBox2
{-0.5, 0, -0.5, 0.5, 0.125, -0.4375}, -- NodeBox3
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375}, -- NodeBox4
{-0.4375, -0.375, -0.5, -0.375, -0.125, 0.5}, -- NodeBox5
{0.375, -0.375, -0.5, 0.4375, -0.125, 0.5}, -- NodeBox6
{-0.375, -0.375, 0.3125, 0.375, -0.3125, 0.4375}, -- NodeBox7
{-0.375, -0.375, 0.125, 0.375, -0.3125, 0.25}, -- NodeBox8
{-0.375, -0.375, -0.0625, 0.375, -0.3125, 0.0625}, -- NodeBox9
{-0.375, -0.375, -0.25, 0.375, -0.3125, -0.125}, -- NodeBox10
{-0.375, -0.375, -0.4375, 0.375, -0.3125, -0.3125}, -- NodeBox11
{-0.375, -0.3125, -0.4375, 0.375, -0.0625, 0.5}, -- NodeBox12
}
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 1.5 }
},
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.under
local pnode = minetest.get_node(pointed_thing.under)
local rnodedef = minetest.registered_nodes[pnode.name]
if not rnodedef["buildable_to"] then
pos = pointed_thing.above
end
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] }
local tnode = minetest.get_node(pos)
local tnode2 = minetest.get_node(pos2)
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
and not minetest.is_protected(pos, placer:get_player_name())
and not minetest.is_protected(pos2, placer:get_player_name()) then
minetest.add_node(pos, { name = "homedecor:bed_blue_foot", param2 = fdir })
minetest.add_node(pos2, { name = "homedecor:bed_blue_head", param2 = fdir })
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:bed_blue_head" then
minetest.remove_node(pos2)
end
end
})
minetest.register_node("homedecor:wardrobe_top", {
tiles = {
"homedecor_wardrobe_top.png",
"homedecor_wardrobe_bottom.png",
"homedecor_wardrobe_sides1.png",
"homedecor_wardrobe_sides1.png^[transformFX",
"homedecor_wardrobe_back1.png",
"homedecor_wardrobe_frontt.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
fixed = {
{-0.5, 0.4375, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.5, -0.4375, -0.4375, 0.5, 0.5}, -- NodeBox2
{0.4375, -0.5, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox3
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5}, -- NodeBox4
{-0.0625, -0.4375, -0.4375, 0.0625, 0.4375, -0.375}, -- NodeBox6
{0.0625, -0.4375, -0.5, 0.4375, 0.4375, -0.4375}, -- NodeBox10
{-0.5, -0.5, -0.4375, 0.5, -0.4375, 0.5}, -- NodeBox11
{-0.4375, -0.4375, -0.5, -0.0625, 0.4375, -0.4375}, -- NodeBox12
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
})
minetest.register_node("homedecor:wardrobe_bottom", {
tiles = {
"homedecor_wardrobe_top.png",
"homedecor_wardrobe_bottom.png",
"homedecor_wardrobe_sides2.png",
"homedecor_wardrobe_sides2.png^[transformFX",
"homedecor_wardrobe_back2.png",
"homedecor_wardrobe_frontb.png"
},
inventory_image = "homedecor_wardrobe_inv.png",
description = "Wardrobe",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.4375, -0.4375, 0.5, 0.5}, -- NodeBox1
{0.4375, -0.5, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox2
{-0.5, -0.5, -0.4375, 0.5, -0.375, -0.375}, -- NodeBox3
{-0.4375, -0.375, -0.5, 0.4375, -0.125, -0.4375}, -- NodeBox4
{-0.4375, -0.125, -0.4375, 0.4375, -0.0625, -0.375}, -- NodeBox12
{-0.4375, -0.0625, -0.5, 0.4375, 0.1875, -0.4375}, -- NodeBox13
{-0.5, 0.1875, -0.4375, 0.5, 0.25, -0.375}, -- NodeBox14
{-0.4375, 0.25, -0.5, 0.4375, 0.5, -0.4375}, -- NodeBox15
{-0.5, 0.4375, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox16
{-0.5, -0.5, 0.4375, 0.5, 0.4375, 0.5}, -- NodeBox17
}
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
},
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.under
local pnode = minetest.get_node(pointed_thing.under)
local rnodedef = minetest.registered_nodes[pnode.name]
if not rnodedef["buildable_to"] then
pos = pointed_thing.above
end
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
local tnode = minetest.get_node(pos)
local tnode2 = minetest.get_node(pos2)
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
and not minetest.is_protected(pos, placer:get_player_name())
and not minetest.is_protected(pos2, placer:get_player_name()) then
minetest.add_node(pos, { name = "homedecor:wardrobe_bottom", param2 = fdir })
minetest.add_node(pos2, { name = "homedecor:wardrobe_top", param2 = fdir })
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
if minetest.get_node(pos2).name == "homedecor:wardrobe_top" then
minetest.remove_node(pos2)
end
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,8]"..
"list[current_name;main;0,0;8,3;]"..
"list[current_player;main;0,4;8,4;]")
meta:set_string("infotext", S("Wardrobe cabinet"))
local inv = meta:get_inventory()
inv:set_size("main", 24)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in wardrobe at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to wardrobe at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from wardrobe at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
})
-- Aliases for 3dforniture mod. -- Aliases for 3dforniture mod.
minetest.register_alias("3dforniture:table", "homedecor:table") minetest.register_alias("3dforniture:table", "homedecor:table")
minetest.register_alias("3dforniture:chair", "homedecor:chair") minetest.register_alias("3dforniture:chair", "homedecor:chair")
minetest.register_alias("3dforniture:armchair", "homedecor:armchair_black") minetest.register_alias("3dforniture:armchair", "homedecor:armchair_black")

View File

@ -634,7 +634,7 @@ minetest.register_node("homedecor:dishwasher_granite", {
groups = { snappy = 3 }, groups = { snappy = 3 },
}) })
-- doghouse, model contributed by jp -- doghouse and pool table, models contributed by jp
minetest.register_node("homedecor:doghouse_base", { minetest.register_node("homedecor:doghouse_base", {
tiles = { tiles = {
@ -752,3 +752,143 @@ minetest.register_node("homedecor:doghouse_roof", {
groups = {snappy=3, not_in_creative_inventory=1}, groups = {snappy=3, not_in_creative_inventory=1},
}) })
local fdir_to_fwd = {
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
}
local swap_fdir = { 2, 3, 0, 1 }
minetest.register_node("homedecor:pool_table", {
tiles = {
"homedecor_pool_table_top1.png",
"homedecor_pool_table_bottom1.png",
"homedecor_pool_table_sides1.png",
"homedecor_pool_table_sides2.png",
"homedecor_pool_table_end1.png",
"homedecor_pool_table_end2.png"
},
description = "Pool Table",
inventory_image = "homedecor_pool_table_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, -0.25, 0.1875, -0.25}, -- NodeBox1
{0.25, -0.5, -0.375, 0.375, 0.1875, -0.25}, -- NodeBox2
{-0.25, -0.125, -0.3125, 0.25, -0.0625, 0}, -- NodeBox3
{-0.3125, -0.0625, -0.3125, -0.25, 0.1875, 0}, -- NodeBox4
{0.25, -0.0625, -0.3125, 0.3125, 0.1875, 0}, -- NodeBox5
{-0.3125, -0.125, 0, 0.3125, 0.1875, 0.0625}, -- NodeBox6
{0.25, -0.125, -0.25, 0.3125, 0.1875, 0.5}, -- NodeBox7
{-0.3125, -0.125, -0.25, -0.25, 0.1875, 0.5}, -- NodeBox8
{-0.5, 0.1875, -0.5, -0.4375, 0.25, 0.5}, -- NodeBox9
{-0.5, 0.1875, -0.5, 0.5, 0.25, -0.4375}, -- NodeBox10
{0.4375, 0.1875, -0.5, 0.5, 0.25, 0.5}, -- NodeBox11
{-0.3125, 0.1875, -0.3125, 0.3125, 0.25, 0.5}, -- NodeBox12
{-0.4375, 0.1875, -0.3125, 0.4375, 0.25, 0.4375}, -- NodeBox13
{-0.3125, 0.1875, -0.5, 0.3125, 0.25, -0.3125}, -- NodeBox14
{-0.25, -0.125, -0.375, 0.25, 0, -0.3125}, -- NodeBox15
{0.25, 0.125, -0.4375, 0.4375, 0.1875, 0.5}, -- NodeBox16
{-0.4375, 0.125, -0.4375, -0.25, 0.1875, 0.5}, -- NodeBox17
{-0.5, 0.25, -0.5, -0.4375, 0.3125, 0.5}, -- NodeBox18
{-0.5, 0.25, -0.5, 0.5, 0.3125, -0.4375}, -- NodeBox19
{0.4375, 0.25, -0.5, 0.5, 0.3125, 0.5}, -- NodeBox20
{-0.4375, 0.25, -0.3125, -0.375, 0.3125, 0.4375}, -- NodeBox23
{-0.3125, 0.25, -0.4375, 0.3125, 0.3125, -0.375}, -- NodeBox24
{0.375, 0.25, -0.3125, 0.4375, 0.3125, 0.4375}, -- NodeBox25
}
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.3125, 1.5 }
},
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.under
local pnode = minetest.get_node(pointed_thing.under)
local rnodedef = minetest.registered_nodes[pnode.name]
if not rnodedef["buildable_to"] then
pos = pointed_thing.above
end
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] }
local tnode = minetest.get_node(pos)
local tnode2 = minetest.get_node(pos2)
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
and not minetest.is_protected(pos, placer:get_player_name())
and not minetest.is_protected(pos2, placer:get_player_name()) then
minetest.add_node(pos, { name = "homedecor:pool_table", param2 = fdir })
print(fdir)
print(swap_fdir[fdir+1])
minetest.add_node(pos2, { name = "homedecor:pool_table2", param2 = swap_fdir[fdir+1] })
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:pool_table2" then
minetest.remove_node(pos2)
end
end
})
minetest.register_node("homedecor:pool_table2", {
tiles = {
"homedecor_pool_table_top2.png",
"homedecor_pool_table_bottom2.png",
"homedecor_pool_table_sides3.png",
"homedecor_pool_table_sides4.png",
"homedecor_pool_table_end3.png",
"homedecor_pool_table_end4.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, -0.25, 0.1875, -0.25}, -- NodeBox1
{0.25, -0.5, -0.375, 0.375, 0.1875, -0.25}, -- NodeBox2
{-0.25, -0.125, -0.3125, 0.25, -0.0625, 0}, -- NodeBox3
{-0.3125, -0.0625, -0.3125, -0.25, 0.1875, 0}, -- NodeBox4
{0.25, -0.0625, -0.3125, 0.3125, 0.1875, 0}, -- NodeBox5
{-0.3125, -0.125, 0, 0.3125, 0.1875, 0.0625}, -- NodeBox6
{0.25, -0.125, -0.25, 0.3125, 0.1875, 0.5}, -- NodeBox7
{-0.3125, -0.125, -0.25, -0.25, 0.1875, 0.5}, -- NodeBox8
{-0.5, 0.1875, -0.5, -0.4375, 0.25, 0.5}, -- NodeBox9
{-0.5, 0.1875, -0.5, 0.5, 0.25, -0.4375}, -- NodeBox10
{0.4375, 0.1875, -0.5, 0.5, 0.25, 0.5}, -- NodeBox11
{-0.3125, 0.1875, -0.3125, 0.3125, 0.25, 0.5}, -- NodeBox12
{-0.4375, 0.1875, -0.3125, 0.4375, 0.25, 0.4375}, -- NodeBox13
{-0.3125, 0.1875, -0.5, 0.3125, 0.25, -0.3125}, -- NodeBox14
{-0.25, -0.125, -0.375, 0.25, 0, -0.3125}, -- NodeBox15
{0.25, 0.125, -0.4375, 0.4375, 0.1875, 0.5}, -- NodeBox16
{-0.4375, 0.125, -0.4375, -0.25, 0.1875, 0.5}, -- NodeBox17
{-0.5, 0.25, -0.5, -0.4375, 0.3125, 0.5}, -- NodeBox18
{-0.5, 0.25, -0.5, 0.5, 0.3125, -0.4375}, -- NodeBox19
{0.4375, 0.25, -0.5, 0.5, 0.3125, 0.5}, -- NodeBox20
{-0.4375, 0.25, -0.3125, -0.375, 0.3125, 0.4375}, -- NodeBox23
{-0.3125, 0.25, -0.4375, 0.3125, 0.3125, -0.375}, -- NodeBox24
{0.375, 0.25, -0.3125, 0.4375, 0.3125, 0.4375}, -- NodeBox25
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B