From 3800e73eb7e44af235e8f296df7f29f43e0468d0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 6 Jan 2017 00:24:50 +0100 Subject: [PATCH] Better chest formspec --- mods/craftingpack/crafting/formspecs.lua | 44 ------------------ mods/craftingpack/crafting/init.lua | 2 - .../textures/crafting_inventory_chest.png | Bin 13142 -> 5497 bytes mods/default/nodes.lua | 31 ++++++------ 4 files changed, 15 insertions(+), 62 deletions(-) delete mode 100644 mods/craftingpack/crafting/formspecs.lua diff --git a/mods/craftingpack/crafting/formspecs.lua b/mods/craftingpack/crafting/formspecs.lua deleted file mode 100644 index 924019e647..0000000000 --- a/mods/craftingpack/crafting/formspecs.lua +++ /dev/null @@ -1,44 +0,0 @@ -default.chest_formspec = - "size[9,9.75]".. - "background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]".. - default.inventory_header.. - "list[current_name;main;0,0.5;9,4;]".. - "list[current_player;main;0,5.5;9,3;9]".. - "list[current_player;main;0,8.74;9,1;]" - -local chest_inv_size = 4*9 -local chest_inv_vers = 2 - -function default.get_locked_chest_formspec(pos) - local meta = minetest.get_meta(pos) - local inv_v = meta:get_int("chest_inv_ver") - if inv_v and inv_v < chest_inv_vers then - local inv = meta:get_inventory() - inv:set_size("main",chest_inv_size) - meta:set_int("chest_inv_ver",chest_inv_vers) - end - local spos = pos.x .. "," .. pos.y .. "," ..pos.z - local formspec = - "size[9,9.75]".. - "background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]".. - default.inventory_header.. - "list[nodemeta:".. spos .. ";main;0,0.5;9,4;]".. - "list[current_player;main;0,5.5;9,3;9]".. - "list[current_player;main;0,8.74;9,1;]" - return formspec -end - -minetest.register_abm({ - nodenames = {"default:chest"}, - interval = 1, - chance = 1, - action = function(pos, node) - local meta = minetest.get_meta(pos) - local inv_v = meta:get_int("chest_inv_ver") - if inv_v and inv_v < chest_inv_vers then - local inv = meta:get_inventory() - inv:set_size("main",chest_inv_size) - meta:set_int("chest_inv_ver",chest_inv_vers) - end - end -}) diff --git a/mods/craftingpack/crafting/init.lua b/mods/craftingpack/crafting/init.lua index 263c4fe3cb..c487039410 100644 --- a/mods/craftingpack/crafting/init.lua +++ b/mods/craftingpack/crafting/init.lua @@ -1,5 +1,3 @@ -dofile(minetest.get_modpath("crafting").."/formspecs.lua") - local show_armor = false if minetest.get_modpath("3d_armor") ~= nil then show_armor = true end diff --git a/mods/craftingpack/crafting/textures/crafting_inventory_chest.png b/mods/craftingpack/crafting/textures/crafting_inventory_chest.png index 5444a005632ebf883d02c9847a8d919b11cf9868..91f317fa468b9beaecf6b8f96d49545befed8b04 100644 GIT binary patch literal 5497 zcmeHL2~ZPf6#fwvZ<em@4CoL4;e7Av55EjT=*|m4Hh=U>_@n=Nnllx2z&l`V z8QloK1~Qhc2?1d6r^v_PUNy5F{%N$`#ch#MtwBFilj(6AMer{Zg$s4T@`$R2>KWS} zE*=?MJJx)=NNP`cWWEqNv+4q-QW!oMeel78G-GSA6OB!v=X6_#s zMQCurY2qKZ*2z+CNaF1~X>ektL(en!8Gdy#L18_E|*ea#Kl$16QfG39;%Fwq> zE;a@Lw96vqmcEJb%D44Vx-r%5qqvlqixUBO{hH|=U}lk45L&m~^_&S*Fxg&wNXWh2 z2LMJ*R?G^43)EWFkzxmx46uYd*7k+Frofx;pn%1I>pp>KfnVW<^N~eFGE9NyIa_P> z?l?yZ#kWbqO--GqWb%9q!&~|Q)-Ai>uDaJP^Oo9qM`f0BMnlg$w$*htqbQ>^s&)LC z{IdJXM<)YhUe!u*VN=_sRH2e7JzxNeBHeKYSKM!97oMWY>T{T?a;{Tu^O)l`0z<%Z zep>R*3&c{E+dR>jOrEUXtIeLq!hACsBTa>Z#arK6lXydMBwH+JKo zNq)8M#>*N?=8GzBp(U%t~vFQ^b|8w(Pl* zxE>RuE3Y*2r{clFM;C7ckqk=@G%N7WVKPiXuW5xT(4-ClFq(A4p3?yukqocAyTLlV z!kl>$Tk2!%O6C8D-kVWq%3%hxJ~x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