From f330d19d03ab7dc0e086a427787c740775e5f504 Mon Sep 17 00:00:00 2001 From: kilbith Date: Wed, 27 Aug 2014 14:24:50 +0200 Subject: [PATCH] Added a deckchair --- homedecor/crafts.lua | 10 ++ homedecor/furniture.lua | 111 ++++++++++++++++++ .../textures/homedecor_deckchair_back.png | Bin 0 -> 526 bytes .../textures/homedecor_deckchair_bottom.png | Bin 0 -> 539 bytes .../textures/homedecor_deckchair_front.png | Bin 0 -> 610 bytes .../textures/homedecor_deckchair_inv.png | Bin 0 -> 5106 bytes .../textures/homedecor_deckchair_sides.png | Bin 0 -> 441 bytes .../textures/homedecor_deckchair_top_c1.png | Bin 0 -> 586 bytes .../textures/homedecor_deckchair_top_c2.png | Bin 0 -> 587 bytes 9 files changed, 121 insertions(+) create mode 100644 homedecor/textures/homedecor_deckchair_back.png create mode 100644 homedecor/textures/homedecor_deckchair_bottom.png create mode 100644 homedecor/textures/homedecor_deckchair_front.png create mode 100644 homedecor/textures/homedecor_deckchair_inv.png create mode 100644 homedecor/textures/homedecor_deckchair_sides.png create mode 100644 homedecor/textures/homedecor_deckchair_top_c1.png create mode 100644 homedecor/textures/homedecor_deckchair_top_c2.png diff --git a/homedecor/crafts.lua b/homedecor/crafts.lua index 4e48a046..30fa37ea 100644 --- a/homedecor/crafts.lua +++ b/homedecor/crafts.lua @@ -2627,4 +2627,14 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + output = "homedecor:deckchair_foot", + recipe = { + { "group:stick", "building_blocks:terrycloth_towel", "group:stick" }, + { "group:stick", "building_blocks:terrycloth_towel", "group:stick" }, + { "group:stick", "building_blocks:terrycloth_towel", "group:stick" } + }, +}) + + diff --git a/homedecor/furniture.lua b/homedecor/furniture.lua index bd2ebb27..46362d47 100644 --- a/homedecor/furniture.lua +++ b/homedecor/furniture.lua @@ -748,6 +748,117 @@ minetest.register_node("homedecor:bench_large_2_right", { }, }) +local fdir_to_fwd = { + { 0, 1 }, + { 1, 0 }, + { 0, -1 }, + { -1, 0 }, +} + +minetest.register_node("homedecor:deckchair_head", { + tiles = { + "homedecor_deckchair_top_c1.png", + "homedecor_deckchair_bottom.png", + "homedecor_deckchair_sides.png", + "homedecor_deckchair_sides.png^[transformFX", + "homedecor_deckchair_back.png", + "homedecor_deckchair_front.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = { snappy = 3, not_in_creative_inventory = 1 }, + node_box = { + type = "fixed", + fixed = { + {-0.375, -0.3125, -0.0625, 0.375, -0.25, 0}, -- NodeBox1 + {-0.375, -0.25, 0, 0.375, -0.1875, 0.0625}, -- NodeBox2 + {-0.375, -0.1875, 0.0625, 0.375, -0.125, 0.125}, -- NodeBox3 + {-0.375, -0.125, 0.125, 0.375, -0.0625, 0.1875}, -- NodeBox4 + {-0.375, -0.0625, 0.1875, 0.375, 0, 0.25}, -- NodeBox5 + {-0.375, 0, 0.25, 0.375, 0.0625, 0.3125}, -- NodeBox6 + {-0.375, 0.0625, 0.3125, 0.375, 0.125, 0.375}, -- NodeBox7 + {-0.375, 0.125, 0.375, 0.375, 0.1875, 0.4375}, -- NodeBox8 + {-0.375, 0.1875, 0.4375, 0.375, 0.25, 0.5}, -- NodeBox9 + {-0.375, -0.375, -0.5, 0.375, -0.3125, 0.0625}, -- NodeBox10 + {0.3125, -0.1875, -0.5, 0.4375, -0.1575, 0.0625}, -- NodeBox11 + {-0.4375, -0.1875, -0.5, -0.3125, -0.1575, 0.0625}, -- NodeBox12 + {0.3125, -0.5, 0, 0.375, -0.25, 0.0625}, -- NodeBox13 + {-0.375, -0.5, 0, -0.3125, -0.25, 0.0625}, -- NodeBox14 + } + }, + selection_box = { + type = "fixed", + fixed = { 0, 0, 0, 0, 0, 0 } + } +}) + +minetest.register_node("homedecor:deckchair_foot", { + tiles = { + "homedecor_deckchair_top_c2.png", + "homedecor_deckchair_bottom.png", + "homedecor_deckchair_sides.png", + "homedecor_deckchair_sides.png^[transformFX", + "homedecor_deckchair_front.png" + }, + inventory_image = "homedecor_deckchair_inv.png", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = { snappy = 3 }, + node_box = { + type = "fixed", + fixed = { + {-0.375, -0.375, -0.5, 0.375, -0.3125, 0.5}, -- NodeBox1 + {0.3125, -0.5, -0.5, 0.375, -0.375, -0.4375}, -- NodeBox2 + {-0.375, -0.5, -0.5, -0.3125, -0.375, -0.4375}, -- NodeBox3 + {0.3125, -0.1875, 0.3, 0.4375, -0.1575, 0.5}, -- NodeBox4 + {-0.4375, -0.1875, 0.3, -0.3125, -0.1575, 0.5}, -- NodeBox5 + {-0.365, -0.3125, 0.32, -0.3225, -0.1875, 0.4375}, -- NodeBox6 + {0.3225, -0.3125, 0.32, 0.365, -0.1875, 0.4375}, -- NodeBox7 + } + }, + selection_box = { + type = "fixed", + fixed = { -0.45, -0.5, -0.5, 0.45, 0.35, 1.5 } + }, + on_place = function(itemstack, placer, pointed_thing) + local pos = pointed_thing.under + local pnode = minetest.get_node(pointed_thing.under) + local rnodedef = minetest.registered_nodes[pnode.name] + + if not rnodedef["buildable_to"] then + pos = pointed_thing.above + end + + local fdir = minetest.dir_to_facedir(placer:get_look_dir()) + local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] } + + local tnode = minetest.get_node(pos) + local tnode2 = minetest.get_node(pos2) + + if homedecor.get_nodedef_field(tnode.name, "buildable_to") + and homedecor.get_nodedef_field(tnode2.name, "buildable_to") + and not minetest.is_protected(pos, placer:get_player_name()) + and not minetest.is_protected(pos2, placer:get_player_name()) then + minetest.add_node(pos, { name = "homedecor:deckchair_foot", param2 = fdir }) + minetest.add_node(pos2, { name = "homedecor:deckchair_head", param2 = fdir }) + if not homedecor.expect_infinite_stacks then + itemstack:take_item() + return itemstack + end + end + end, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local fdir = oldnode.param2 + if not fdir or fdir > 3 then return end + local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] } + if minetest.get_node(pos2).name == "homedecor:deckchair_head" then + minetest.remove_node(pos2) + end + end +}) + -- Aliases for 3dforniture mod. minetest.register_alias("3dforniture:table", "homedecor:table") diff --git a/homedecor/textures/homedecor_deckchair_back.png b/homedecor/textures/homedecor_deckchair_back.png new file mode 100644 index 0000000000000000000000000000000000000000..7657666b5402f7d5b32140d4f5e56423900e6b6c GIT binary patch literal 526 zcmV+p0`dKcP)AQDXoA02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00DMML_t(I%Z<@HlH4#1MbV27 z)vk8nO?f-sy=yFy1fBzF@(x%xA`9TLKfhDg3|>cZ%^+Nu#FlZ+#LRfd24K6fmoY}O zmNQ0^|IS2$?@HhX-A=k#Z7d9HaZYE9B7L(xN#EqirX}3$se=FmT>Q)epw0O8TA-#e z-ec1kX(r49qc96HHr0Wd2ssjbtpn%2=rj_T-P5MY$S72I=S<9mJBa3ZiTCSdH>e9U zD4d`voLv2k{G3eTCe)B2+&~7eY^scF3e=PVYBE9`SLT*rSyo-@yZBW2)z` zaEPZFk9&)c{6~s5XIRtbqzoh>vyc3*oy_eV+05-^uiHJnKJu6D|EPWUKjDH(-Lc&; Qm;e9(07*qoM6N<$f>I6RIRF3v literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_deckchair_bottom.png b/homedecor/textures/homedecor_deckchair_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..d70ab9ccce1eefc2ccaa8dc7462d295c27747611 GIT binary patch literal 539 zcmV+$0_6RPP)02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00DzZL_t(I%Z-se(i1@p1zSI} z`(Xmk!*RHOO2K+&q(`tev7?uCt4h`O>*qI((VR!|oI$uSi7n%riJ9?;4ZwC|FJp{m zEoY3z&71Vi-z%vyb{Qq3+esHKSQxwEx|}!v-h7NrV~lKC!p%W|0WQ900nldrI2WjC zjJKDw5(&m=%z}(fbzmk!js$2R)XEs&Fa|+ay-Cmj*Ai~9w#q2;5;eZ=!!IooX;P*jz z{eVad@w}Y#DAsbiVfJ89$PEgPM=?^Y4GM1lt9f2dR>6^?+A#?MYs0qW!3Klt8T@|r z59;P$Ual3)6`V)m#{d4SjfG(?uIY?Xq;KX*<_eBc%oXGjje8URS^qbm#=RS3c;i{0 z^$#(;S#pLq83>$@`>Sp~UYjGEHYYypKT@CONE literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_deckchair_front.png b/homedecor/textures/homedecor_deckchair_front.png new file mode 100644 index 0000000000000000000000000000000000000000..437ec1fdb09f7861ba0e0be1146ef7f164a68b9a GIT binary patch literal 610 zcmV-o0-gPdP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00GKLL_t(I%T<6ZK8xgkZNvI8Drsk2mu`6I+BG^-KZ!u zAb>WHz5pl@K3)R4DCDhRF2}tPG2D_>hDc+rbi?1+P>x2W=zea`LvR_3D&^a+-yp&^ zj@hMxZ8L5mhzK*1Z7AQret!FdRX`W2ikZ;eWCj-(=1dwVGZ0`#LDexPpuq8(fCyAW z#AJ*?18z#p$rw(H;HoG8BCuwrf(TU$HD{j_Qz2KO?(BPDs$}&Ge~z$V^Je7&5r!M$ z&RW5?ITeDq-!rh2KLruS48w;bKt!UZJPaeVh-_39cO!G1Jj5Z`tWYhKW>sUR3^Ot( z?uMx_%(%@R_i^%P28l4V$7vUaOKBCw~fz27R@KTu17Fn-S|(?c?On z42Bma%8#cnm^S9n2(HCi!af@s+?x_T`BSi`GgJBSEe znRJWxr6xK$2^v(?n6ysJM2Ty$R22v!I|v9Adlgl6w)c6Sdp?{)X(khU(xV2P++WUh zoe$@{|Np)H@B4n?kM>79F71M;sT9C39=|jGfB7AAyb_?Q4Oh=K*Tu06Ir`m}jZ5YC z{hjD|C7|HVtNl+tuOY4-cK62hEnD-2;#FgsX1}s+^YTc&^P|T%>qj;ME}Lopwtu=f zux`+>@Zu|LSh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z1{3s z-^wo*-i@)A*amVXafkEPi14#VmnRb^HQN1acLl$8cTkQq`>n0;m2)x%I2C9uHwMJU zTAqj%x{H-10i6E$iqfkb=k_}RHy~^oFfq>unhRB7}((>fW;{TY~ zU>mLIX@VXUm~nEW>3y>OqXGV3wTq|60&vNU=s)oPt6egqytFv_`A7SseYEU<0aWMC UoC#Y!8UO$Q07*qoM6N<$f`&;Gr~m)} literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_deckchair_sides.png b/homedecor/textures/homedecor_deckchair_sides.png new file mode 100644 index 0000000000000000000000000000000000000000..b1f6ede29c923ecaeed07ddbf7d8ccb8c6085bca GIT binary patch literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)07>Q0e)yoj?)J0*}aI z1_o|n5N2eUHAey{$X?><>&kwQLz>e_*mQbQ15ik^#5JPCIX^cyHLrxhxhOTUBsE2$ zJhLQ2!QIn0AiR-JoPmK+(bL5-#NzbZOBZ>C0|lHfzMgq=jfh=FSJ?`=&YW+1B|i&J zSiu;D&yWT`YSsM@8D(Z+~BkJr_XvL z#m9|a!c5%fq;?(sZB}7%s;B8{0{hfVxvO_3-%w-b*eI66p5<7>b#PC4;rj(i0s$-2 z)+VsMv$V*NX=*#Z+49sHUcZX?#=k$E9bAIBZbYZd2!6f2*+uB1(eM7|*N+zz{eP

gTe~DWM4fZtAFh literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_deckchair_top_c1.png b/homedecor/textures/homedecor_deckchair_top_c1.png new file mode 100644 index 0000000000000000000000000000000000000000..9ec1b269a2a47fdf7233a042e7377925fc1ed841 GIT binary patch literal 586 zcmV-Q0=4~#P)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00FW|L_t(I%T<#*jub%<1tUMz z!wxsX;uiSa0*Q-YaS?R`N8O+X0cjN9SWuLWl4AQ`NO@BQGEIS14KB6BO*vG zj>C9ef`~9za17<^r;nJyx1X=#0HTFyV5U?zkx5l@Ka4qpD5WZKbLL7Ka18();68#v z$ZF_j9FDk?IYGe95ckIfzWFVf>2!muAZn}?sKUEph`{eNPytsZA~(MUw~-{u%T35k zj+-#t$x5o4`*G#hb8;KD`7Ou-x`-&u6cEn20RGD&LS$|pxHKYy$n~vi)>@3m_}$NZ zEl)T96j(Dui4x9$#98H3HzKn08E~d3q+_&)SPop-rtPKLftvfg%2mPp8P*SAPg-s z5=0nok3(7m|Z{4wYd4C1&nhoM3soO`DcwGDD`Y1^4dDrLt6PJ``A3d YUxm#a^S8vQ#{d8T07*qoM6N<$f_UxpB>(^b literal 0 HcmV?d00001 diff --git a/homedecor/textures/homedecor_deckchair_top_c2.png b/homedecor/textures/homedecor_deckchair_top_c2.png new file mode 100644 index 0000000000000000000000000000000000000000..a103643b9341e53055fc2a84968018b5cb567c2b GIT binary patch literal 587 zcmV-R0<`^!P)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00FZ}L_t(I%T<$2j+8MBM4uh! zYo@so`?&;S#XXSb8f-ZT5{DYmU*aDY=}9-6NF}|L>`Fzditk^p)qC>e*Ke{45g{|U z9*xXoq>>p}Ga{3>udno;{QPqh0}xG2oydYJ`eBF}5d#FQHN=cDouk|40Sw^UokTDd zL>qHDs_>~dMBx2&RKQemkIip`5k?ifT!e_=xCq^h$RM-09!uZO!KJs&Z-Yw@0>wRP zO#$H?6W~8BB6!5+fptc%V})1DIqCQDs~);oYkcr~0uccUPa(1pF=iT7zAmuz=|MEz z{GLEsF?JZ}hsdpzmF!#Dp}A>gn=1hQbxLGOKy+>|*6y&EO6Cc5)`g*h8z zHnRgeg`+jx9aW*}UC)84ZhjkdOGM@A72urr;&>q3 zwJPp&^V{Hb_7ngB literal 0 HcmV?d00001