From cf0b3a49158bab49b3767211f652487103d4670b Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sat, 18 Apr 2015 15:05:26 +0200 Subject: [PATCH] support texture packs --- init.lua | 25 ++++++++++++++++--------- textures/connected_chests_frame.png | Bin 0 -> 88 bytes textures/connected_chests_front.png | Bin 120 -> 105 bytes textures/connected_chests_lock.png | Bin 162 -> 113 bytes textures/connected_chests_side.png | Bin 627 -> 74 bytes textures/connected_chests_top.png | Bin 561 -> 25 bytes 6 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 textures/connected_chests_frame.png mode change 100644 => 120000 textures/connected_chests_top.png diff --git a/init.lua b/init.lua index 06d5b35..9235433 100644 --- a/init.lua +++ b/init.lua @@ -126,20 +126,27 @@ local function return_remove_next(allowed_name) return remove_next end + + local function log_access(pos, player, text) minetest.log("action", player:get_player_name().. " moves stuff "..text.." at "..minetest.pos_to_string(pos)) end +-- Adds the big chests + +local top_texture = "connected_chests_top.png^default_chest_top.png^([combine:16x16:5,0=default_chest_top.png^connected_chests_frame.png^[makealpha:255,126,126)^connected_chests_top.png" +local side_texture = "connected_chests_side.png^default_chest_side.png^([combine:16x16:5,0=default_chest_side.png^connected_chests_frame.png^[makealpha:255,126,126)^connected_chests_side.png" + local chest = table.copy(minetest.registered_nodes["default:chest"]) chest.description = nil chest.legacy_facedir_simple = nil chest.after_place_node = nil chest.on_construct = nil chest.on_receive_fields = nil -chest.tiles = {"connected_chests_top.png", "connected_chests_top.png", "default_obsidian_glass.png", - "default_chest_side.png", "connected_chests_side.png^[transformFX", "connected_chests_side.png^connected_chests_front.png"} +chest.tiles = {top_texture, top_texture, "default_obsidian_glass.png", + "default_chest_side.png", side_texture.."^[transformFX", side_texture.."^connected_chests_front.png"} chest.drop = "default:chest 2" chest.selection_box = { type = "fixed", @@ -161,15 +168,14 @@ end minetest.register_node("connected_chests:chest_left", chest) - local chest_locked = table.copy(minetest.registered_nodes["default:chest_locked"]) chest_locked.description = nil chest_locked.legacy_facedir_simple = nil chest_locked.after_place_node = nil chest_locked.on_construct = nil chest_locked.on_receive_fields = nil -chest_locked.tiles = {"connected_chests_top.png", "connected_chests_top.png", "default_obsidian_glass.png", - "default_chest_side.png", "connected_chests_side.png^[transformFX", "connected_chests_side.png^connected_chests_lock.png"} +chest_locked.tiles = {top_texture, top_texture, "default_obsidian_glass.png", + "default_chest_side.png", side_texture.."^[transformFX", side_texture.."^connected_chests_front.png^connected_chests_lock.png"} chest_locked.drop = "default:chest_locked 2" chest_locked.selection_box = { type = "fixed", @@ -204,8 +210,8 @@ minetest.register_node("connected_chests:chest_locked_left", chest_locked) minetest.register_node("connected_chests:chest_right", { - tiles = {"connected_chests_top.png^[transformFX", "connected_chests_top.png^[transformFX", "default_chest_side.png", - "default_obsidian_glass.png", "connected_chests_side.png", "connected_chests_side.png^connected_chests_front.png^[transformFX"}, + tiles = {top_texture.."^[transformFX", top_texture.."^[transformFX", "default_chest_side.png", + "default_obsidian_glass.png", side_texture, side_texture.."^connected_chests_front.png^[transformFX"}, paramtype2 = "facedir", drop = "", pointable = false, @@ -213,14 +219,15 @@ minetest.register_node("connected_chests:chest_right", { }) minetest.register_node("connected_chests:chest_locked_right", { - tiles = {"connected_chests_top.png^[transformFX", "connected_chests_top.png^[transformFX", "default_chest_side.png", - "default_obsidian_glass.png", "connected_chests_side.png", "connected_chests_side.png^connected_chests_lock.png^[transformFX"}, + tiles = {top_texture.."^[transformFX", top_texture.."^[transformFX", "default_chest_side.png", + "default_obsidian_glass.png", side_texture, side_texture.."^connected_chests_front.png^connected_chests_lock.png^[transformFX"}, paramtype2 = "facedir", drop = "", pointable = false, diggable = false, }) +-- abms to fix half chests for _,i in pairs({"chest", "chest_locked"}) do minetest.register_abm ({ nodenames = {"connected_chests:"..i.."_right"}, diff --git a/textures/connected_chests_frame.png b/textures/connected_chests_frame.png new file mode 100644 index 0000000000000000000000000000000000000000..c7af3f96382f24854b07a721c79808b41f57e2ba GIT binary patch literal 88 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%_o-U3d6^zM0;={ks7dg|wcj9sn kL-SGA#d;E@2Ul=2eD+d4A7Q=ZCQvDZr>mdKI;Vst0I#7L!~g&Q literal 0 HcmV?d00001 diff --git a/textures/connected_chests_front.png b/textures/connected_chests_front.png index fc1b629db47106c8ceb067c97bcb11b1a4e35c45..5b9e68b3cbc8387a6893a05c36fc65522dbfbc45 100644 GIT binary patch delta 74 zcmb=(oS@=r;OXKRQo)!kaWX+i}bW-Wd00000NkvXXu0mjfpQ9m03Y-JVE_OCX-PyuRCobn7{Ne|lkq>Xc{+~a8{=cg* z6M2RlU6}Fz`Sa)huV24To&j#^a{mt=Jotb9{P|>iI<^`XP_L60sx{pDZF9UeUktH3IG5}MNUMnLSTYdibY5O diff --git a/textures/connected_chests_side.png b/textures/connected_chests_side.png index b0b19a7ecd4bfe18b01b35f10a03101ee60e5b97..ada6be5906b43eeccc44e25fcd20a4097ce67016 100644 GIT binary patch delta 55 zcmey&;x$3ikd1+XLH_gqL?9*T>Eakt!I<386llQZc2I+Xfkl9U@mj5HFi?`g)78&q Iol`;+0FxySDF6Tf delta 612 zcmV-q0-OCx^8}C?e*ypi0FaSrHUIzuI!Q!9R4C6Sk-d%_MHEKAd+VpWdU|$ecWta; zEkJ-}IUq#hWe|ZAzky%CPeICSkRTBeAR;0=1B0>AvNO|N-Boq(C7A34Cpglf*FU}r zeIJL*l27cM3mv;aWOZ5c{f9V=m$y$^KDD~EW$G_(d@K38e{Wy)p3DHifFibuyf$lU zYWC5_ugwlc$H>Q3Jo`}9zPRd{Km;b5i}Zo3Saft+^>!E6rc2d6@ZH?}uzTp4&bBD} zNER3%z=r6GSQRT`XFCP{%n+`WA}?zScxhZIuZN}2yV^h5vQ z&wqB09<);Oaq2e7hj965?{7Z+>iLWB1I)};0TTcaz=Yf^IWpi-Z3q;A`)a-}Q}5~7 zegj~s+SEK#6-$wG(IGMu{X4a><6JcbW+ImY50M=qe+BkT!4Uw@g8ZF{$gPSgN6CN*1|I;L=L1vqZDXX-oyNP*X;YB(+u9Iavi%+Lo;fv2L} zmKi`3tDY9?x;mI4Ft zFl%c2UaL5*vR1v>h9)M8_lI&l1|l5h*2H!jzf>K2Pk;RM^3AWmT|d5!DIMSam6sxU y`SR;;{(k-YbjS}Lf1Ho^>pZ86OTex_`RsoY5m83TjbX0<0000=|UGvleQPiC+fc^itwdl7Q? z{WdSlwB5CGP&3Q3S{7kn*Yb2fZO?Z%pGG;1zK-=}xqOpGD__6dZjuB60AvkZWGT+> z2=eAUl@SkXsLDE+H09>}_;yi&2vp?Qe979KlgXjR&DB&#Ec=lS0MhpAT~eId9#|$} zRzLu5Cu`2`Y)%heE(SnTo>hc|2TWlqo2<=aGVRW6Qb$C9z+>?`sA9S ztdq%4Y95@Y4Lm`Mi1()8Qo1gQYWOl+J8&sIm3{ z5Tpk^crhD*1hNJ1{v69-ckX5#L=cZPo{wFCmrf`C?Rz$PSVNwEe*5?P$M*WY<+(oJ z_uit_w;w<6|Nd&FoL#@~>weUdHN4XKo9000000NkvXXu0mjfZA<@y diff --git a/textures/connected_chests_top.png b/textures/connected_chests_top.png new file mode 120000 index 0000000..ae4a17c --- /dev/null +++ b/textures/connected_chests_top.png @@ -0,0 +1 @@ +connected_chests_side.png \ No newline at end of file