From afa3829a240c5ee3c17ff0373b08264c56e34319 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 26 Jun 2014 09:17:45 -0400 Subject: [PATCH] add medicine cabinet --- homedecor/misc_nodes.lua | 59 ++++++++++++++++++ .../homedecor_medicine_cabinet_back.png | Bin 0 -> 209 bytes .../homedecor_medicine_cabinet_front.png | Bin 0 -> 262 bytes .../homedecor_medicine_cabinet_sides.png | Bin 0 -> 304 bytes .../homedecor_medicine_cabinet_tb.png | Bin 0 -> 298 bytes 5 files changed, 59 insertions(+) create mode 100644 homedecor/textures/homedecor_medicine_cabinet_back.png create mode 100644 homedecor/textures/homedecor_medicine_cabinet_front.png create mode 100644 homedecor/textures/homedecor_medicine_cabinet_sides.png create mode 100644 homedecor/textures/homedecor_medicine_cabinet_tb.png diff --git a/homedecor/misc_nodes.lua b/homedecor/misc_nodes.lua index 8735fe2b..ffeefd9f 100644 --- a/homedecor/misc_nodes.lua +++ b/homedecor/misc_nodes.lua @@ -616,4 +616,63 @@ minetest.register_node("homedecor:dishwasher", { groups = { snappy = 3 }, }) +minetest.register_node('homedecor:medicine_cabinet', { + drawtype = "nodebox", + description = S("Medicine Cabinet"), + tiles = { + 'homedecor_medicine_cabinet_tb.png', + 'homedecor_medicine_cabinet_tb.png', + 'homedecor_medicine_cabinet_sides.png', + 'homedecor_medicine_cabinet_sides.png', + 'homedecor_medicine_cabinet_back.png', + 'homedecor_medicine_cabinet_front.png' + }, + sunlight_propagates = false, + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + selection_box = { + type = "fixed", + fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5} + }, + node_box = { + type = "fixed", + fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5} + }, + 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;1,0;6,1;]".. + "list[current_player;main;0,3;8,4;]") + meta:set_string("infotext", S("Medicine 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 medicine 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 medicine 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 medicine cabinet at %s"):format( + player:get_player_name(), + minetest.pos_to_string(pos) + )) + end, +}) diff --git a/homedecor/textures/homedecor_medicine_cabinet_back.png b/homedecor/textures/homedecor_medicine_cabinet_back.png new file mode 100644 index 0000000000000000000000000000000000000000..1defe6eac536018360acfb9eee202c9e0b2f3de5 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|Gdx`!Lp07Or!+M7`4qFUwVnQM z_fqR)rlx27?(b73cYnV!b@?u@nmI9he(tSSI5k6JLc_F4Cd|yt>f-t>fB)W24--pc z3u(B(5XjChAT1#wk!SO(E0$R=VTIyHpzIu}h{zd=mw?&}N(GiDUEJ{QfUb}J!!ON? zSmrNmW0__CAyYx++8v+MT9om!dT9jiptKKTb<9}OjhKPuE06|w*S!(p5sfGt5qr5KdS<%qm z-adW$_t)3g1Gy0tuSi;*1gw)0Lh4rm|{Q3DAD7e4=chAwb z&*pIpB>(^Zp5M_X-M=sCV!{f=#x=8M&;D)9Ba!8iaPh<6+vz*9b|fn}1UB_MXc!t9 zDP<=(FmdpHkFPnD^=G<%{JOip@dK#wtay85}S Ib4q9e0LwIQ@c;k- literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_medicine_cabinet_sides.png b/homedecor/textures/homedecor_medicine_cabinet_sides.png new file mode 100644 index 0000000000000000000000000000000000000000..40099f457d118d0d6b96a2aa2a602c4afca1bc0f GIT binary patch literal 304 zcmV-00nh%4P)j zy9$Fa6upf)sOT&N1RaVMXXg&xx^?N=-*f2~bm$*A6jVCsBxF|5L4^)if{nI%hLCVy z=bYT#?HqWv?z^;LRom3Byb1&ASZ0!!s%FF)!)TJ1zDw`VH-R;%nt^AMmjFQKu|+tR z>AO@cXq#G*CA|ACZJSys>-vFo{Q%n#J<@RkYH}=7)r>#&VL%mGA{*Nmta2=KoDe-y zL2kjSUzJ3WrR(Xy--;~FwNATirG$I{V8JEynPkElI87O1X zWis81IAg0~z9@ONjte5lnEFQM+rk$U^YD(e0pJ6Xk8EUwB!0>O0000ZrT_pu>jprZTKEfEmm_WLB+mfs52tyN4pRl-Qe8v#Fjb_D?R5Km-YmwF$}c6f zvBbT-Hm;U)9`_r7uL&WJ=W1P!J}0G(O`PaIU_aiX=S3+E|ME?U8sTE|TqX%nZ)h>5E4GtQ(r;ie+)jUlt$FRWaxRAjjY$OqZ8&W|GIy w#)fmGF~kh-ZhtuOzmi=TUrEbEr3cc07p359FFNP&5&!@I07*qoM6N<$f{I;)ZvX%Q literal 0 HcmV?d00001