added granite-, steel-, marble-topped cabinets

(no craft recipes yet)
This commit is contained in:
Vanessa Ezekowitz 2014-06-25 03:33:11 -04:00
parent 9731dfe396
commit 6cb4f449a1
5 changed files with 67 additions and 48 deletions

View File

@ -2,54 +2,67 @@
local S = homedecor.gettext local S = homedecor.gettext
minetest.register_node('homedecor:kitchen_cabinet', { local counter_materials = { "", "granite", "marble", "steel" }
description = S("Kitchen Cabinet"),
tiles = { 'homedecor_kitchen_cabinet_top.png', for _, mat in ipairs(counter_materials) do
'homedecor_kitchen_cabinet_bottom.png',
'homedecor_kitchen_cabinet_sides.png', local desc = S("Kitchen Cabinet")
'homedecor_kitchen_cabinet_sides.png', local material = ""
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_front.png'}, if mat ~= "" then
sunlight_propagates = false, desc = S("Kitchen Cabinet ("..mat.." top)")
paramtype = "light", material = "_"..mat
paramtype2 = "facedir", end
walkable = true,
groups = { snappy = 3 }, minetest.register_node('homedecor:kitchen_cabinet'..material, {
sounds = default.node_sound_wood_defaults(), description = desc,
on_construct = function(pos) tiles = { 'homedecor_kitchen_cabinet_top'..material..'.png',
local meta = minetest.get_meta(pos) 'homedecor_kitchen_cabinet_bottom.png',
meta:set_string("formspec", 'homedecor_kitchen_cabinet_sides.png',
"size[8,8]".. 'homedecor_kitchen_cabinet_sides.png',
"list[current_name;main;0,0;8,3;]".. 'homedecor_kitchen_cabinet_sides.png',
"list[current_player;main;0,4;8,4;]") 'homedecor_kitchen_cabinet_front.png'},
meta:set_string("infotext", S("Kitchen Cabinet")) sunlight_propagates = false,
local inv = meta:get_inventory() paramtype = "light",
inv:set_size("main", 24) paramtype2 = "facedir",
end, walkable = true,
can_dig = function(pos,player) groups = { snappy = 3 },
local meta = minetest.get_meta(pos); sounds = default.node_sound_wood_defaults(),
local inv = meta:get_inventory() on_construct = function(pos)
return inv:is_empty("main") local meta = minetest.get_meta(pos)
end, meta:set_string("formspec",
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) "size[8,8]"..
minetest.log("action", S("%s moves stuff in kitchen cabinet at %s"):format( "list[current_name;main;0,0;8,3;]"..
player:get_player_name(), "list[current_player;main;0,4;8,4;]")
minetest.pos_to_string(pos) meta:set_string("infotext", S("Kitchen Cabinet"))
)) local inv = meta:get_inventory()
end, inv:set_size("main", 24)
on_metadata_inventory_put = function(pos, listname, index, stack, player) end,
minetest.log("action", S("%s moves stuff to kitchen cabinet at %s"):format( can_dig = function(pos,player)
player:get_player_name(), local meta = minetest.get_meta(pos);
minetest.pos_to_string(pos) local inv = meta:get_inventory()
)) return inv:is_empty("main")
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s takes stuff from kitchen cabinet at %s"):format( minetest.log("action", S("%s moves stuff in kitchen cabinet at %s"):format(
player:get_player_name(), player:get_player_name(),
minetest.pos_to_string(pos) minetest.pos_to_string(pos)
)) ))
end, end,
}) on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to kitchen 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 kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
})
end
minetest.register_node('homedecor:kitchen_cabinet_half', { minetest.register_node('homedecor:kitchen_cabinet_half', {
drawtype="nodebox", drawtype="nodebox",

View File

@ -121,6 +121,12 @@ local items = {
"Fridge (stainless steel)" }, "Fridge (stainless steel)" },
{ "kitchen_cabinet", { "kitchen_cabinet",
"Cabinet" }, "Cabinet" },
{ "kitchen_cabinet_steel",
"Cabinet (stainless steel top)" },
{ "kitchen_cabinet_granite",
"Cabinet (granite top)" },
{ "kitchen_cabinet_marble",
"Cabinet (marble top)" },
{ "kitchen_cabinet_half", { "kitchen_cabinet_half",
"Cabinet" }, "Cabinet" },
{ "kitchen_cabinet_with_sink", { "kitchen_cabinet_with_sink",

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B