From 264d6e90f967a8e74e2cfcf4477e68b002f87203 Mon Sep 17 00:00:00 2001 From: Fernando Zapata Date: Thu, 2 Aug 2012 07:11:33 -0600 Subject: [PATCH] new better looking hatches --- hatch/depends.txt | 1 + hatch/init.lua | 91 ++++++++++++++++++++++++++++++++ hatch/textures/hatch_wood_a.png | Bin 0 -> 659 bytes hatch/textures/hatch_wood_h.png | Bin 0 -> 308 bytes hatch/textures/hatch_wood_v.png | Bin 0 -> 315 bytes 5 files changed, 92 insertions(+) create mode 100644 hatch/depends.txt create mode 100644 hatch/init.lua create mode 100644 hatch/textures/hatch_wood_a.png create mode 100644 hatch/textures/hatch_wood_h.png create mode 100644 hatch/textures/hatch_wood_v.png diff --git a/hatch/depends.txt b/hatch/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/hatch/depends.txt @@ -0,0 +1 @@ +default diff --git a/hatch/init.lua b/hatch/init.lua new file mode 100644 index 0000000..0e6f138 --- /dev/null +++ b/hatch/init.lua @@ -0,0 +1,91 @@ +-------------------------------------------------------------------------------- +-- Hatch +-------------------------------------------------------------------------------- +-- Á hatch/trapdoor similar to the one introduced in Minecraft Beta 1.6 +-- +-- 2012-07-31 08:19:13 +-- +-- (c)2012 Fernando Zapata (ZLovesPancakes, Franz.ZPT) +-- Code licensed under GNU GPLv2 +-- http://www.gnu.org/licenses/gpl-2.0.html +-- Content licensed under CC BY-SA 3.0 +-- http://creativecommons.org/licenses/by-sa/3.0/ +-------------------------------------------------------------------------------- + +------------------------------------------------------------- Constants -------- + +hatch = {} + +------------------------------------------------------------- Functions -------- + +function hatch.open( p, n ) + minetest.env:set_node( p, { name='hatch:hatch_o', param2=n.param2 } ) +end + +function hatch.close( p, n ) + minetest.env:set_node( p, { name='hatch:hatch_c', param2=n.param2 } ) +end + +--function hatch.toggle( p ) +-- local n = minetest.env:get_node( p ) +-- if p.name == 'hatch:hatch_o' then +-- +--end + +----------------------------------------------------------------- Nodes -------- + +minetest.register_node( 'hatch:hatch_c', { + description = 'Hatch', + --inventory_image = 'hatch_wood_a.png', + --wield_image = 'hatch_wood_a.png', + groups = { snappy = 1, + choppy = 2, + oddly_breakable_by_hand = 2, + flammable = 3 }, + tiles = { 'hatch_wood_a.png', + 'hatch_wood_a.png', + 'hatch_wood_h.png' }, + drawtype = 'nodebox', + paramtype = 'light', + paramtype2 = 'facedir', + sunlight_propagates = true, + node_box = { type = 'fixed', + fixed = { -1/2, -1/2, -1/2, 1/2, -5/16, 1/2 } }, + selection_box = { type = 'fixed', + fixed = { -1/2, -1/2, -1/2, 1/2, -5/16, 1/2 } }, + drop = 'hatch:hatch_c', + sounds = default.node_sound_wood_defaults(), + on_punch = hatch.open +}) + +minetest.register_node( 'hatch:hatch_o', { + description = 'Hatch', + groups = { snappy = 1, + choppy = 2, + oddly_breakable_by_hand = 2, + flammable = 3 }, + tiles = { 'hatch_wood_h.png', 'hatch_wood_h.png', + 'hatch_wood_v.png', 'hatch_wood_v.png', + 'hatch_wood_a.png', 'hatch_wood_a.png' }, + drawtype = 'nodebox', + paramtype = 'light', + paramtype2 = 'facedir', + sunlight_propagates = true, + node_box = { type = 'fixed', + fixed = { -1/2, -1/2, 5/16, 1/2, 1/2, 1/2} }, + selection_box = { type = 'fixed', + fixed = { -1/2, -1/2, 5/16, 1/2, 1/2, 1/2} }, + drop = 'hatch:hatch_c', + sounds = default.node_sound_wood_defaults(), + on_punch = hatch.close +}) + +---------------------------------------------------------------- Recipe -------- + +minetest.register_craft({ + output = 'hatch:hatch_c 2', + recipe = { { 'default:wood', 'default:wood', 'default:wood' }, + { 'default:wood', 'default:wood', 'default:wood' } } +}) + +-------------------------------------------------------------------------------- diff --git a/hatch/textures/hatch_wood_a.png b/hatch/textures/hatch_wood_a.png new file mode 100644 index 0000000000000000000000000000000000000000..346decad424c4cd632eddec69c0699998e7412a0 GIT binary patch literal 659 zcmV;E0&M+>P)| zNo!P55QV=xyeXZjTRVv$5;ubW2f>Zem0N$1OIL!31O9<*1(BeFJ3&c;Lv#}ai5X1N z(e6%Ozx&?3<>EC>V%O?&Pf=CpoGNwq#wCd(O+T-Qt>*u?D+5L=TorItpfwfK={aT^ z5v~kafUAo$02r;XM$w##>2w{|C`2H49)O9&;Dex*B6pr2+x@yg78^SIzvNONy_ zYlOXia#KEhT*Z|E9ow2`<%QGHoXQwDkI@RH7z<+5UCkcrWXEH<>JYezP|d}4MoW^4b1Z0JT_c(f0K_rgSC&`M#nB8cFsKpbiQ9+v>P zDsa?uG*XMv3P04$#!=1X*RNgjB8+%mUc68*P#M_XuCXl9q>-k*Fi#pA8mYy)vhD=% z@a67E%2$tW$@h)V|Y&XY*Av8tCogy9U<4*<1^bjm2dBD*Q+`4_6mQ*apUy{15)d zAl!^!wcur)H1KbUjR{js7L$zzI$gvzupmt5r~At~l?AuK3KM|Qj<%8R_4Q@4u1d+~ zcTZE!<~e(}6ec>@E6qJ7(}L%#2EclgKNhjq3Br`K1Na8TWPT$V$m2=?0000n1ww6 literal 0 HcmV?d00001 diff --git a/hatch/textures/hatch_wood_v.png b/hatch/textures/hatch_wood_v.png new file mode 100644 index 0000000000000000000000000000000000000000..e3bd5a21c7615c24977e8ef7c6ab2ba86b882645 GIT binary patch literal 315 zcmV-B0mS}^P)NjuZ z&Cv4d%rHsR>%|HF&dusM6}z}NG=^>;-Z2_i@a6ejL@g0oKeT=r2R^@g!{jWpDkcRx z%i};jb-oi-a6NOXa76}aw&C<>7XZJke*k2aoaK);_#mu`B$owLQ98p_Y10$N0f}1A zoH4|yg+6BA+H8VhVi8Sk97q#eKd=u%gfL__gds{)B5>)X zDiNXC1SUc`G0iq)mAXC>fqf?ub$_qODpjRbg}r-R;~xoqT;0D()L+KKepXBG91{Ql N002ovPDHLkV1mgqeNX@Z literal 0 HcmV?d00001