From 6cb4f449a143d0d9ac6b1ea8edb312ae61f1cfa1 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Wed, 25 Jun 2014 03:33:11 -0400 Subject: [PATCH] added granite-, steel-, marble-topped cabinets (no craft recipes yet) --- homedecor/kitchen_cabinet.lua | 109 ++++++++++-------- homedecor/locked.lua | 6 + .../homedecor_kitchen_cabinet_top_granite.png | Bin 0 -> 853 bytes .../homedecor_kitchen_cabinet_top_marble.png | Bin 0 -> 819 bytes .../homedecor_kitchen_cabinet_top_steel.png | Bin 0 -> 102 bytes 5 files changed, 67 insertions(+), 48 deletions(-) create mode 100644 homedecor/textures/homedecor_kitchen_cabinet_top_granite.png create mode 100644 homedecor/textures/homedecor_kitchen_cabinet_top_marble.png create mode 100644 homedecor/textures/homedecor_kitchen_cabinet_top_steel.png diff --git a/homedecor/kitchen_cabinet.lua b/homedecor/kitchen_cabinet.lua index 0f522553..d35dbe41 100644 --- a/homedecor/kitchen_cabinet.lua +++ b/homedecor/kitchen_cabinet.lua @@ -2,54 +2,67 @@ local S = homedecor.gettext -minetest.register_node('homedecor:kitchen_cabinet', { - description = S("Kitchen Cabinet"), - tiles = { 'homedecor_kitchen_cabinet_top.png', - 'homedecor_kitchen_cabinet_bottom.png', - 'homedecor_kitchen_cabinet_sides.png', - 'homedecor_kitchen_cabinet_sides.png', - 'homedecor_kitchen_cabinet_sides.png', - 'homedecor_kitchen_cabinet_front.png'}, - sunlight_propagates = false, - paramtype = "light", - paramtype2 = "facedir", - walkable = true, - 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,8]".. - "list[current_name;main;0,0;8,3;]".. - "list[current_player;main;0,4;8,4;]") - meta:set_string("infotext", S("Kitchen 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 kitchen 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 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, -}) +local counter_materials = { "", "granite", "marble", "steel" } + +for _, mat in ipairs(counter_materials) do + + local desc = S("Kitchen Cabinet") + local material = "" + + if mat ~= "" then + desc = S("Kitchen Cabinet ("..mat.." top)") + material = "_"..mat + end + + minetest.register_node('homedecor:kitchen_cabinet'..material, { + description = desc, + tiles = { 'homedecor_kitchen_cabinet_top'..material..'.png', + 'homedecor_kitchen_cabinet_bottom.png', + 'homedecor_kitchen_cabinet_sides.png', + 'homedecor_kitchen_cabinet_sides.png', + 'homedecor_kitchen_cabinet_sides.png', + 'homedecor_kitchen_cabinet_front.png'}, + sunlight_propagates = false, + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + 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,8]".. + "list[current_name;main;0,0;8,3;]".. + "list[current_player;main;0,4;8,4;]") + meta:set_string("infotext", S("Kitchen 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 kitchen 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 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', { drawtype="nodebox", diff --git a/homedecor/locked.lua b/homedecor/locked.lua index 32a160a1..088a703a 100644 --- a/homedecor/locked.lua +++ b/homedecor/locked.lua @@ -121,6 +121,12 @@ local items = { "Fridge (stainless steel)" }, { "kitchen_cabinet", "Cabinet" }, + { "kitchen_cabinet_steel", + "Cabinet (stainless steel top)" }, + { "kitchen_cabinet_granite", + "Cabinet (granite top)" }, + { "kitchen_cabinet_marble", + "Cabinet (marble top)" }, { "kitchen_cabinet_half", "Cabinet" }, { "kitchen_cabinet_with_sink", diff --git a/homedecor/textures/homedecor_kitchen_cabinet_top_granite.png b/homedecor/textures/homedecor_kitchen_cabinet_top_granite.png new file mode 100644 index 0000000000000000000000000000000000000000..70de1163c53b6c04813e4da2b367d47ace74f6b7 GIT binary patch literal 853 zcmV-b1FHOqP)Ru1iW|pXKu8=o^~#^<|KZF9aX{(;p-LzS z8WlA`2}!)fYdp4RzFB!5@$Ji(#ZITma6BT)bOzHA%|?^KXv|^TeUKGAqYdsIt)=v3S7rzwU+dTV{#N+ufbp* zA+rKgQ<<$oPA><%zZr9OJs>X>WEhelP$shAtUu*Jy+XyUAPkc@j_7t8blWa6&G_p1 zAw`x^bF2LQ{*pI;zN73n`QyV4;)n0QDKt$ZPEwMhAWw51Ha-6OZ%7o!bUQx2S0V~y zt_BkfO`~GjTnvV6He9p~&qL@c!nFD6m*2^CgSQt$s-}*n3v5G>#ggetaWj-pbiDYorWQUzYEij)b43clxZI}1?8 zvpFaGJ4A)XML!_Va)b~ZKkah7_mHeGiDiPWTP(r|w`_AY4LH3Vuv!HunNS&w$2{NP z#IILyOD48mq1PX9pR1Hjjc45szGo4~DTb!esX92e#dSYG8P6h?GH1PBvkoQCKI)?D zg83pMj}|0J!u2fR;Bl9e{T-56@}ym7yX~XfD&q4OFN)m_pS#(dG%qN~DccsK`4ZQ* zuyqBAib)2Fj;Vp8>#VYz`C^6US_acaK$;iGG(#1FX%M2SDuRsJDnY0MVd#*@tfQ2< fP{}D!6@~u+y6$VHc^hZu00000NkvXXu0mjfkC&3z literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_kitchen_cabinet_top_marble.png b/homedecor/textures/homedecor_kitchen_cabinet_top_marble.png new file mode 100644 index 0000000000000000000000000000000000000000..66d7c37822e8710be57e832962c0362d0a97c05c GIT binary patch literal 819 zcmV-31I+x1P)xS(4|A?4&7TIMT#JCYA1Cp$*yEs zlqHiCNr^n{(4r6U;~ReQ{SQA@zT?p895B0Eu!-_mnvDjoX`L zB8nm=x3?S|?6G)=>Fl=XbbE;Nt8t}E&AYQRilQLNbG*9G)#nkeXCs9q3`2@Sqm<;; z=@%%a*lagAo{wCoYqZvsx*|$*9{2l9r&9`D5cmP5u2`;O9M|EyZ@=NF-=p1ZvcI!S z96g|-D8h3*!uu5nnBC1eefgZ}?VMh^f^;UjvxVK$$$2p3qkg)TL5vPKSiU8FKm66~7d^_#aS0ekHh%|;#9 zG->;Fk~GHXONH#`xwIWe6HUfJ)PpJkLnhF|O+{pN9;u xC)8aRfOVQtGixXbLKxVVNtC1{>6SuQ`~z59YALhT7hM1V002ovPDHLkV1mlsji>+s literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_kitchen_cabinet_top_steel.png b/homedecor/textures/homedecor_kitchen_cabinet_top_steel.png new file mode 100644 index 0000000000000000000000000000000000000000..9cc6c7b97d99f5b7f284be5ebace4ad6c73ca883 GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6bUj@hLp07O=lnn4AiiOPp+LX^ z$Bj&7PFy=Qwl(qXd$8!n>?yw=$ttqSb7(Ly7_qRh?Yr;J3Dn5o>FVdQ&MBb@09m{p Awg3PC literal 0 HcmV?d00001