add filing cabinet

This commit is contained in:
Vanessa Ezekowitz 2014-06-26 08:10:10 -04:00
parent d5d219eadc
commit 33ffaf6d21
7 changed files with 64 additions and 0 deletions

View File

@ -139,6 +139,8 @@ local items = {
"Nightstand" }, "Nightstand" },
{ "nightstand_mahogany_two_drawers", { "nightstand_mahogany_two_drawers",
"Nightstand" }, "Nightstand" },
{ "filing_cabinet",
"Filing cabinet" },
{ "oven", { "oven",
"Oven" }, "Oven" },
{ "oven_active", { "oven_active",

View File

@ -524,3 +524,65 @@ minetest.register_node("homedecor:dvd_cd_cabinet", {
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
minetest.register_node('homedecor:filing_cabinet', {
drawtype = "nodebox",
description = S("Filing Cabinet"),
tiles = {
'homedecor_filing_cabinet_top.png',
'homedecor_filing_cabinet_bottom.png',
'homedecor_filing_cabinet_sides.png',
'homedecor_filing_cabinet_sides.png^[transformFX',
'homedecor_filing_cabinet_back.png',
'homedecor_filing_cabinet_front.png'
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, -30/64, 8/16, 8/16, 8/16 }, -- main body
{ -7/16, -7/16, -8/16, 7/16, 7/16, 8/16 }, -- drawer
}
},
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,7]"..
"list[current_name;main;0,0;8,2;]"..
"list[current_player;main;0,3;8,4;]")
meta:set_string("infotext", S("Filing cabinet"))
local inv = meta:get_inventory()
inv:set_size("main", 16)
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 filing cabinet 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 filing cabinet 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 filing cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B