multiple changes

fridge has new models by jp, and now uses two nodes instead of one.

an abm has been added to convert the old one-node version into this new
two-node version. inventories are kept in the process, but I can't do
anything about fridges that are themselves in someone's inventory or
chests.  If you want to keep them, place them in the world before you
update.

added coat rack on wall, and freestanding coat tree, models by jp

added doorbell, model and texture by jp with changes by me
This commit is contained in:
Vanessa Ezekowitz 2014-08-14 14:05:41 -04:00
parent 588ef63da5
commit e8dd191cfd
34 changed files with 330 additions and 78 deletions

View File

@ -2403,3 +2403,26 @@ minetest.register_craft( {
{ "default:cobble", "", "default:cobble" }
},
})
minetest.register_craft( {
output = "homedecor:coat_tree",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "", "group:stick", "" },
{ "", "group:wood", "" }
},
})
minetest.register_craft( {
output = "homedecor:coatrack_wallmount",
recipe = {
{ "group:stick", "homedecor:curtainrod_wood", "group:stick" },
},
})
minetest.register_craft( {
output = "homedecor:doorbell",
recipe = {
{ "homedecor:light_switch", "homedecor:power_crystal", "homedecor:speaker_driver" }
},
})

View File

@ -115,10 +115,10 @@ local function create_locked ( name, infotext )
end
local items = {
{ "refrigerator",
"Fridge" },
{ "refrigerator_steel",
"Fridge (stainless steel)" },
{ "refrigerator_white_bottom",
"Refrigerator" },
{ "refrigerator_steel_bottom",
"Refrigerator (stainless steel)" },
{ "kitchen_cabinet",
"Cabinet" },
{ "kitchen_cabinet_steel",

View File

@ -1083,3 +1083,74 @@ minetest.register_node("homedecor:well_top", {
},
})
minetest.register_node("homedecor:coatrack_wallmount", {
tiles = { "homedecor_coatrack_wood.png" },
inventory_image = "homedecor_coatrack_wallmount_inv.png",
description = "Coatrack (wallmounted)",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.375, 0, 0.4375, 0.375, 0.14, 0.5}, -- NodeBox1
{-0.3025, 0.0475, 0.375, -0.26, 0.09, 0.4375}, -- NodeBox2
{0.26, 0.0475, 0.375, 0.3025, 0.09, 0.4375}, -- NodeBox3
{0.0725, 0.0475, 0.375, 0.115, 0.09, 0.4375}, -- NodeBox4
{-0.115, 0.0475, 0.375, -0.0725, 0.09, 0.4375}, -- NodeBox5
{0.24, 0.025, 0.352697, 0.3225, 0.115, 0.375}, -- NodeBox6
{-0.3225, 0.025, 0.352697, -0.24, 0.115, 0.375}, -- NodeBox7
{-0.135, 0.025, 0.352697, -0.0525, 0.115, 0.375}, -- NodeBox8
{0.0525, 0.025, 0.352697, 0.135, 0.115, 0.375}, -- NodeBox9
}
},
})
minetest.register_node("homedecor:coat_tree", {
tiles = { "homedecor_coatrack_wood.png" },
description = "Coat tree",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{0, -0.5, 0, 0.0625, 1.5, 0.0625}, -- NodeBox1
{-0.125, -0.5, -0.125, 0.1875, -0.4375, 0.1875}, -- NodeBox2
{0.1875, -0.5, -0.0625, 0.22, -0.4375, 0.125}, -- NodeBox3
{-0.0625, -0.5, 0.188, 0.125, -0.4375, 0.22}, -- NodeBox4
{-0.16, -0.5, -0.0625, -0.125, -0.4375, 0.125}, -- NodeBox5
{-0.0625, -0.5, -0.16, 0.125, -0.4375, -0.125}, -- NodeBox6
{-0.25, 1.1875, 0, 0.3125, 1.25, 0.0625}, -- NodeBox7
{0, 1.1875, -0.25, 0.0625, 1.25, 0.3125}, -- NodeBox8
{-0.0207468, 1.4375, -0.0207468, 0.0829876, 1.5, 0.0829876}, -- NodeBox9
}
},
})
minetest.register_node("homedecor:doorbell", {
tiles = { "homedecor_doorbell.png" },
inventory_image = "homedecor_doorbell_inv.png",
description = "Doorbell",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=1},
node_box = {
type = "fixed",
fixed = {
{-0.0625, 0, 0.46875, 0.0625, 0.1875, 0.5}, -- NodeBox1
{-0.03125, 0.0625, 0.45, 0.03125, 0.125, 0.4675}, -- NodeBox2
}
},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.sound_play("homedecor_doorbell", {
gain = 1.0,
max_hear_distance = 32
})
end
})

View File

@ -2,34 +2,94 @@
local S = homedecor.gettext
minetest.register_node('homedecor:refrigerator', {
drawtype = "nodebox",
description = S("Refrigerator"),
tiles = {
'homedecor_refrigerator_top.png',
'homedecor_refrigerator_bottom.png',
'homedecor_refrigerator_right.png',
'homedecor_refrigerator_left.png',
'homedecor_refrigerator_back.png',
'homedecor_refrigerator_front.png'
},
inventory_image = "homedecor_refrigerator_inv.png",
sunlight_propagates = false,
paramtype = "light",
-- nodebox models
local fridge_model_bottom = {
type = "fixed",
fixed = {
{0, -0.4375, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.5, -0.42, 0.5, 0.5, 0.5}, -- NodeBox2
{-0.5, -0.4375, -0.4375, -0.0625, 0.5, 0.5}, -- NodeBox3
{0, 0.25, -0.5, 0.0625, 0.3125, -0.4375}, -- NodeBox4
{-0.125, 0.25, -0.5, -0.0625, 0.3125, -0.4375}, -- NodeBox5
{0, 0.25, -0.5, 0.0625, 0.5, -0.473029}, -- NodeBox6
{-0.125, 0.25, -0.5, -0.0625, 0.5, -0.473029}, -- NodeBox7
}
}
local fridge_model_top = {
type = "fixed",
fixed = {
{0, -0.5, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.0625, -0.5, -0.42, 0, 0.5, 0.5}, -- NodeBox2
{-0.5, -0.5, -0.4375, -0.0625, -0.4375, 0.5}, -- NodeBox3
{-0.5, -0.5, -0.4375, -0.4375, 0.5, 0.5}, -- NodeBox4
{-0.5, -0.1875, -0.4375, -0.0625, 0.5, 0.5}, -- NodeBox5
{-0.4375, -0.4375, -0.125, -0.0625, -0.1875, 0.5}, -- NodeBox6
{-0.125, -0.4375, -0.4375, -0.0625, -0.1875, -0.125}, -- NodeBox7
{-0.3125, -0.3125, -0.307054, -0.25, -0.1875, -0.286307}, -- NodeBox8
{-0.125, 0, -0.5, -0.0625, 0.0625, -0.4375}, -- NodeBox9
{0, 0, -0.5, 0.0625, 0.0625, -0.4375}, -- NodeBox10
{0, -0.5, -0.5, 0.0625, 0.0625, -0.473029}, -- NodeBox11
{-0.125, -0.5, -0.5, -0.0625, 0.0625, -0.473029}, -- NodeBox12
}
}
-- steel-textured fridge
minetest.register_node("homedecor:refrigerator_steel_bottom", {
tiles = {
"default_steel_block.png",
"homedecor_refrigerator_steel_bottom.png",
"homedecor_refrigerator_steel_sides2.png",
"homedecor_refrigerator_steel_sides2.png^[transformFX",
"homedecor_refrigerator_steel_back2.png",
"homedecor_refrigerator_steel_front2.png"
},
inventory_image = "homedecor_refrigerator_steel_inv.png",
description = S("Refrigerator (stainless steel)"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
groups = {snappy=3},
node_box = fridge_model_bottom,
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]
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
},
if not rnodedef["buildable_to"] then
pos = pointed_thing.above
end
sounds = default.node_sound_wood_defaults(),
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:refrigerator_steel_bottom", param2 = fdir })
minetest.add_node(pos2, { name = "homedecor:refrigerator_steel_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:refrigerator_steel_top" then
minetest.remove_node(pos2)
end
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
@ -40,16 +100,6 @@ minetest.register_node('homedecor:refrigerator', {
local inv = meta:get_inventory()
inv:set_size("main",50)
end,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.chat_send_player( placer:get_player_name(), S('Not enough vertical space to place a refrigerator!') )
return
end
return minetest.item_place(itemstack, placer, pointed_thing)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
@ -75,75 +125,183 @@ minetest.register_node('homedecor:refrigerator', {
end,
})
minetest.register_node('homedecor:refrigerator_steel', {
drawtype = "nodebox",
description = S("Refrigerator (stainless steel)"),
tiles = {
'homedecor_refrigerator_steel_top.png',
'homedecor_refrigerator_steel_bottom.png',
'homedecor_refrigerator_steel_right.png',
'homedecor_refrigerator_steel_left.png',
'homedecor_refrigerator_steel_back.png',
'homedecor_refrigerator_steel_front.png'
},
inventory_image = "homedecor_refrigerator_steel_inv.png",
sunlight_propagates = false,
paramtype = "light",
minetest.register_node("homedecor:refrigerator_steel_top", {
tiles = {
"homedecor_refrigerator_steel_top.png",
"default_steel_block.png",
"homedecor_refrigerator_steel_sides1.png",
"homedecor_refrigerator_steel_sides1.png^[transformFX",
"homedecor_refrigerator_steel_back1.png",
"homedecor_refrigerator_steel_front1.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
groups = {snappy=3},
node_box = fridge_model_top,
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
})
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
},
-- white, enameled fridge
sounds = default.node_sound_wood_defaults(),
minetest.register_node("homedecor:refrigerator_white_bottom", {
tiles = {
"default_steel_block.png",
"homedecor_refrigerator_white_bottom.png",
"homedecor_refrigerator_white_sides2.png",
"homedecor_refrigerator_white_sides2.png^[transformFX",
"homedecor_refrigerator_white_back2.png",
"homedecor_refrigerator_white_front2.png"
},
inventory_image = "homedecor_refrigerator_white_inv.png",
description = S("Refrigerator"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = fridge_model_bottom,
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:refrigerator_white_bottom", param2 = fdir })
minetest.add_node(pos2, { name = "homedecor:refrigerator_white_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:refrigerator_white_top" then
minetest.remove_node(pos2)
end
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[10,10]"..
"list[current_name;main;0,0;10,5;]"..
"list[current_player;main;1,6;8,4;]")
meta:set_string("infotext", S("Refrigerator (stainless steel)"))
meta:set_string("infotext", S("Refrigerator"))
local inv = meta:get_inventory()
inv:set_size("main",50)
end,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.chat_send_player( placer:get_player_name(), S('Not enough vertical space to place a refrigerator!') )
return
end
return minetest.item_place(itemstack, placer, pointed_thing)
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 steel refrigerator at %s"):format(
minetest.log("action", S("%s moves stuff in refrigerator 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 steel refrigerator at %s"):format(
minetest.log("action", S("%s moves stuff to refrigerator 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 steel refrigerator at %s"):format(
minetest.log("action", S("%s takes stuff from refrigerator at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
})
minetest.register_node("homedecor:refrigerator_white_top", {
tiles = {
"homedecor_refrigerator_white_top.png",
"default_steel_block.png",
"homedecor_refrigerator_white_sides1.png",
"homedecor_refrigerator_white_sides1.png^[transformFX",
"homedecor_refrigerator_white_back1.png",
"homedecor_refrigerator_white_front1.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = fridge_model_top,
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
})
-- convert the old single-node fridges to the new two-node models
minetest.register_abm({
nodenames = { "homedecor:refrigerator" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_white_bottom", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_white_top", param2 = fdir })
end
})
minetest.register_abm({
nodenames = { "homedecor:refrigerator_locked" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_white_bottom_locked", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_white_top", param2 = fdir })
end
})
minetest.register_abm({
nodenames = { "homedecor:refrigerator_steel" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_steel_bottom", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_steel_top", param2 = fdir })
end
})
minetest.register_abm({
nodenames = { "homedecor:refrigerator_steel_locked" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_steel_bottom_locked", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_steel_top", param2 = fdir })
end
})

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

View File

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

View File

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B