mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-23 08:20:21 +01:00
add filing cabinet
This commit is contained in:
parent
d5d219eadc
commit
33ffaf6d21
@ -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",
|
||||||
|
@ -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,
|
||||||
|
})
|
||||||
|
BIN
homedecor/textures/homedecor_filing_cabinet_back.png
Normal file
BIN
homedecor/textures/homedecor_filing_cabinet_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 629 B |
BIN
homedecor/textures/homedecor_filing_cabinet_bottom.png
Normal file
BIN
homedecor/textures/homedecor_filing_cabinet_bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 676 B |
BIN
homedecor/textures/homedecor_filing_cabinet_front.png
Normal file
BIN
homedecor/textures/homedecor_filing_cabinet_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 683 B |
BIN
homedecor/textures/homedecor_filing_cabinet_sides.png
Normal file
BIN
homedecor/textures/homedecor_filing_cabinet_sides.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 635 B |
BIN
homedecor/textures/homedecor_filing_cabinet_top.png
Normal file
BIN
homedecor/textures/homedecor_filing_cabinet_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 656 B |
Loading…
Reference in New Issue
Block a user