From 87e5ed95a03fdcca3409f23c2d397902a3006db9 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 30 Sep 2012 21:16:41 -0400 Subject: [PATCH] Added chainlink fence gate. Place a fence back into the crafting grid to get a gate. Place it, then click it to open/close. --- crafts.lua | 16 +++ fences.lua | 93 +++++++++++++++++- textures/homedecor_fence_chainlink_fb.png | Bin 475 -> 500 bytes ...omedecor_fence_chainlink_gate_backside.png | Bin 0 -> 601 bytes .../homedecor_fence_chainlink_gate_front.png | Bin 0 -> 591 bytes .../homedecor_fence_chainlink_gate_sides.png | Bin 0 -> 505 bytes .../homedecor_fence_chainlink_gate_tb.png | Bin 0 -> 490 bytes 7 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 textures/homedecor_fence_chainlink_gate_backside.png create mode 100644 textures/homedecor_fence_chainlink_gate_front.png create mode 100644 textures/homedecor_fence_chainlink_gate_sides.png create mode 100644 textures/homedecor_fence_chainlink_gate_tb.png diff --git a/crafts.lua b/crafts.lua index 098faac..7a953e5 100644 --- a/crafts.lua +++ b/crafts.lua @@ -1157,3 +1157,19 @@ minetest.register_craft( { { "default:steel_ingot", "default:iron_lump", "default:steel_ingot" } }, }) + +minetest.register_craft( { + type = "shapeless", + output = "homedecor:fence_chainlink_gate_closed", + recipe = { + "homedecor:fence_chainlink" + }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "homedecor:fence_chainlink", + recipe = { + "homedecor:fence_chainlink_gate_closed" + }, +}) diff --git a/fences.lua b/fences.lua index 297e894..e9d62ae 100644 --- a/fences.lua +++ b/fences.lua @@ -172,10 +172,95 @@ minetest.register_node("homedecor:fence_chainlink", { node_box = { type = "fixed", fixed = { - { -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post - { 7/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post - { -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } -- the chainlink itself + { -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post + { 7/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post + { -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece + { -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } -- the chainlink itself } }, }) + +minetest.register_node("homedecor:fence_chainlink_gate_closed", { + drawtype = "nodebox", + description = "Chainlink Fence Gate", + tiles = { + "homedecor_fence_chainlink_gate_tb.png", + "homedecor_fence_chainlink_gate_tb.png", + "homedecor_fence_chainlink_gate_sides.png", + "homedecor_fence_chainlink_gate_sides.png", + "homedecor_fence_chainlink_gate_backside.png", + "homedecor_fence_chainlink_gate_front.png", + }, + paramtype = "light", + is_ground_content = true, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), + walkable = true, + paramtype2 = "facedir", + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 } + }, + node_box = { + type = "fixed", + fixed = { + { -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post + { -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece + { -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }, -- the chainlink itself + { -8/16, -3/16, 6/16, -6/16, 3/16, 8/16 } -- the lump representing the lock + } + }, +}) + +minetest.register_node("homedecor:fence_chainlink_gate_open", { + drawtype = "nodebox", + description = "Chainlink Fence Gate (open)", + tiles = { + "homedecor_fence_chainlink_gate_tb.png", + "homedecor_fence_chainlink_gate_tb.png", + "homedecor_fence_chainlink_gate_front.png", + "homedecor_fence_chainlink_gate_backside.png", + "homedecor_fence_chainlink_gate_sides.png", + "homedecor_fence_chainlink_gate_sides.png", + }, + paramtype = "light", + is_ground_content = true, + groups = {snappy=3, not_in_creative_inventory=1}, + sounds = default.node_sound_wood_defaults(), + walkable = true, + paramtype2 = "facedir", + selection_box = { + type = "fixed", + fixed = { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5 } + }, + node_box = { + type = "fixed", + fixed = { + { 6/16, -8/16, -8/16, 8/16, 8/16, -7/16 }, -- left post + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post + { 13/32, 7/16, -8/16, 15/32, 8/16, 8/16 }, -- top piece + { 13/32, -8/16, -8/16, 15/32, -7/16, 8/16 }, -- bottom piece + { 7/16, -8/16, -8/16, 7/16, 8/16, 8/16 }, -- the chainlink itself + { 6/16, -3/16, -8/16, 8/16, 3/16, -6/16 } -- the lump representing the lock + } + }, + drop = "homedecor:fence_chainlink_gate_closed" +}) + +minetest.register_on_punchnode(function (pos, node) + if node.name=="homedecor:fence_chainlink_gate_closed" then + fdir=node.param2 + minetest.env:add_node(pos, { name = "homedecor:fence_chainlink_gate_open", param2 = fdir }) + end +end) + +minetest.register_on_punchnode(function (pos, node) + if node.name=="homedecor:fence_chainlink_gate_open" then + fdir=node.param2 + minetest.env:add_node(pos, { name = "homedecor:fence_chainlink_gate_closed", param2 = fdir }) + end +end) + diff --git a/textures/homedecor_fence_chainlink_fb.png b/textures/homedecor_fence_chainlink_fb.png index 93e718665c5adae450594da4412bf058789be424..d140c0cea2377b50efac7a2b3a46d4a3375a5736 100644 GIT binary patch delta 446 zcmV;v0YU!T1M~xsKz|AW06QYG_NVLs00EOpL_t(I%Z*aa&Vn!yoL0p6NO}>U*8~NB zP!ttQ6g>DK9!-o=q5B=o8f!H9_R>tdnVFrfP)d<82CnPE7=y>-0U-p8F>o9QbzK7h zT-Sw^5@lJ!aU2LCP}eo2)*9FA6`f8;TrL-Qo+rw(M8Dq`w}0CWp67}C{f=(8E6(RL zdcEEYx7%&ta5xYEgkeZ{tLb!V;n{3v;V6noDMbi^fVeq|A_9QEEWsv zJ&t2Sp63=bH*qbOOAD{p>laSblu#4}jYcC&ffd;{J7MhmJ^?^c6a=LdeN*~$@~+J9 z!{Lyy+wEwzT7OvzoCP~$awg@#kH;e+%QA~O2!elaW3$;1(lmWqd9!Jy3?NAo>tx4y zp401+n}21%V{s)(LRpp(eBXa%!1l-Ev6The<}BE$Qi^aooh;_hAIal<%V59XKQrJa zW@e?&t?*cr$%Ftr7r_7Eb7pS(xe7nD*k#=vnL)O8I2 za9tOjP6t(0!EqcYrBK&3I?v}5x7!W9UQb=GS9qSMs;a_pIDb_4`yHO=smJ4ie!s6S zmkS1iL4&*9E^s^^1pvY@6trqSpIdmbSXelUBGFn4f*=q!M^PjIuv{*sO%lhk0KjUs zvfkr378FHcF|&!aUau{@-EJG4WtpHXOPNe2mI4)Nn@)&*-xmNV%Tl1VmTyX*PTI0;na*{Ie)9ED0^W0(%g5clVNYhl1W!c+G%chkwfFwz*la7m` zkmi!jzcS!htRzV!&vSwA`%MP4Kb=mkENGiq(5cp1a6X?c=FcC=alU16I2_&?u!+o6 z`rHb~n$2bc;JpC;gU^}S^vg*YhB6wB1iRg?`H8eoG9IpwI89UQUTZCXINNw?H3&x? P00000NkvXXu0mjfBHzFH diff --git a/textures/homedecor_fence_chainlink_gate_backside.png b/textures/homedecor_fence_chainlink_gate_backside.png new file mode 100644 index 0000000000000000000000000000000000000000..75d949d44cbefd359cb1f9a804571277f0d0a817 GIT binary patch literal 601 zcmV-f0;c_mP)%P*z*eEx+Mxthb_z;Ioc z9mn~QDEmrTVdY4XwA*cVU6-lX>v1ZTLO!1-#k^cDxl}4qRJl^AP}JG!bi(y|g~((w z&@}B+%xpH}QmI7Be!t)6N~J<7yJ?zSE|=+cyCI!U1FO}FH=7OrPy2(x;DZ~D2De%* z7KuaxM1;j+!PRP&9LHe*a2$tgwHm4HmSu6hUME#_GMNMs0o(1CUDy3mQg;7p-?nXT zHk<4?4ns=Ghr@vtv&ydGD6-LL#L*aw#o~Q)yWNh};%^7)@%+9(HOJ$TvE6QYzu)tC zJpQ`pXzNjD%Bf{p?=R5lbXXPlm$D-N?L%=*VTLf00000NkvXXu0mjf;Cc^# literal 0 HcmV?d00001 diff --git a/textures/homedecor_fence_chainlink_gate_front.png b/textures/homedecor_fence_chainlink_gate_front.png new file mode 100644 index 0000000000000000000000000000000000000000..89871796e928b7ccd054a233a1e251e4384e5977 GIT binary patch literal 591 zcmV-V00005*NklU-p-E{e$-$xSyap8@t6QGnN0WzV%s(WU^<NlF1~_=Q9e0f=~?O z@tDP8QFOaqDjWHHUMSFBuSZ?ikxHe2X0yp!t@cK@EbG78Sg+SyE|=7V5J)5vZ<&=! zMW_~R+h)037E($AfRvJ@Qc29`a|$6|cOa!?y((Yz};^5 zvf#Qd|Kxcv82nR-l#=asn_{(E(J%~ z=kwthV<`myRP{VhM09D+xz>8UUf=I`N-2a8V;p0!s>T@a_d5UpfUCzCV+;TYA@~6i zpU-DXi4aj$y#o;efSHXk{8v@ogNUs)5uuclh#;bf_`##h%*=eAoOADeUDpr-@B4ne zUJ=owYpvb{0LB=e<_RJaLZC6m_xp7SIp=j<9e}Dbv!~Ts=XrJ~G4njnF-9}1wI0Wj zbM^#ByetbM)>?_k%-GCCL{-g>oQX(P+00b+cDpgNs=7NOx;p>> z05c!QQA+8(uj`74lu{xh062~V0AdD!FviSrApqo@w{4@=8Z-aj2w@^Jv);Rz#pzn> zG)-Jearcm)=UGHlHI{J?0EkFRNmWIJhGE$EJ+{B!FCwaHEQ8hg5fLI1B97yDx(~59 zYG!97GjsQp67T!|o0vr;93x`RSwxQG2%s?l0J-}x3}zO{PbVT$N{Nfqa6iX>oYmE|4c|;VEGgTDg?ol~0|H@X?h#QpRjUZyYm-A5(A}-4k zzT>wOe*_4Vz4!3UrIgR-bHCq-h?(7e-}iAG14hI(vt?NxkB5kGz<$5qDW!-t3