From 355eac6b3682833500872c63dbbf3388115aa534 Mon Sep 17 00:00:00 2001 From: Mossmanikin Date: Sat, 12 Oct 2013 15:09:39 +0200 Subject: [PATCH] Bush branches with leaves 2, code for spawning --- bushes/init.lua | 126 +++++++++++------- bushes/textures/BushBranchesCenterLeaves2.png | Bin 0 -> 487 bytes bushes/textures/BushBranchesSide1Leaves2.png | Bin 0 -> 689 bytes bushes/textures/BushBranchesSide2Leaves2.png | Bin 0 -> 719 bytes .../{ => old & unused}/BlockBranch1.png | Bin .../{ => old & unused}/BlockBranch1L.png | Bin .../{ => old & unused}/BlockBranch1R.png | Bin .../{ => old & unused}/BushBranches1.png | Bin .../{ => old & unused}/BushBranches1sm.png | Bin .../{ => old & unused}/BushBranches1sm2.png | Bin .../{ => old & unused}/BushBranches1sm3.png | Bin .../{ => old & unused}/BushBranches1sm4.png | Bin .../{ => old & unused}/BushBranchesCenter.png | Bin .../{ => old & unused}/BushBranchesSide1.png | Bin .../{ => old & unused}/BushBranchesSide2.png | Bin .../moretrees_pine_leaves3.png | Bin 16 files changed, 78 insertions(+), 48 deletions(-) create mode 100644 bushes/textures/BushBranchesCenterLeaves2.png create mode 100644 bushes/textures/BushBranchesSide1Leaves2.png create mode 100644 bushes/textures/BushBranchesSide2Leaves2.png rename bushes/textures/{ => old & unused}/BlockBranch1.png (100%) rename bushes/textures/{ => old & unused}/BlockBranch1L.png (100%) rename bushes/textures/{ => old & unused}/BlockBranch1R.png (100%) rename bushes/textures/{ => old & unused}/BushBranches1.png (100%) rename bushes/textures/{ => old & unused}/BushBranches1sm.png (100%) rename bushes/textures/{ => old & unused}/BushBranches1sm2.png (100%) rename bushes/textures/{ => old & unused}/BushBranches1sm3.png (100%) rename bushes/textures/{ => old & unused}/BushBranches1sm4.png (100%) rename bushes/textures/{ => old & unused}/BushBranchesCenter.png (100%) rename bushes/textures/{ => old & unused}/BushBranchesSide1.png (100%) rename bushes/textures/{ => old & unused}/BushBranchesSide2.png (100%) rename bushes/textures/{ => old & unused}/moretrees_pine_leaves3.png (100%) diff --git a/bushes/init.lua b/bushes/init.lua index f7dce5a..a338012 100644 --- a/bushes/init.lua +++ b/bushes/init.lua @@ -7,67 +7,83 @@ abstract_bushes = {} - minetest.register_node("bushes:bushbranches1", { - description = "bushbranches1", - drawtype = "nodebox", - tiles = { - "blank.png", - "BushBranchesCenter.png", - "BushBranchesCenter.png", - "BushBranchesCenter.png", - "BushBranchesCenter.png", - "BushBranchesCenter.png" - }, - node_box = { - type = "fixed", - fixed = { - {0, -1/2, -1/2, -1/4, 1/2, 1/2}, - {0, -1/2, -1/2, 1/4, 1/2, 1/2} - }, - }, - selection_box = { - type = "fixed", - fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, - }, - inventory_image = "BushBranchesCenter.png", - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - groups = {tree=1, snappy=3, flammable=2, leaves=1}, - sounds = default.node_sound_leaves_defaults(), -}) - -local BushBranchNode = { {2}, {3}} -for i in pairs(BushBranchNode) do - local Num = BushBranchNode[i][1] + local BushBranchCenter = { {1,1}, {3,2} } +for i in pairs(BushBranchCenter) do + local Num = BushBranchCenter[i][1] + local TexNum = BushBranchCenter[i][2] minetest.register_node("bushes:bushbranches"..Num, { - description = "bushbranches"..Num, + description = "Bush Branches "..Num, drawtype = "nodebox", tiles = { - "blank.png", - "BushBranchesSide1.png", - "BushBranchesSide1.png", - "BushBranchesSide2.png", - "BushBranchesSide2.png", - "BushBranchesCenter.png" + "bush_leaves"..TexNum..".png", + "BushBranchesCenterLeaves"..TexNum..".png"--[[, + "BushBranchesCenter.png", + "BushBranchesCenter.png", + "BushBranchesCenter.png", + "BushBranchesCenter.png"]] }, node_box = { type = "fixed", fixed = { - {0.137748,-0.491944,0.5,-0.125000,-0.179444,-0.007790}, --NodeBox 1 - {0.262748,-0.185995,0.5,-0.237252,0.126505,-0.260269}, --NodeBox 2 - {0.500000,0.125000,0.500000,-0.500000,0.500000,-0.500000}, --NodeBox 3 + {0, -1/2, -1/2, -1/4, 1/2, 1/2}, + {0, -1/2, -1/2, 1/4, 1/2, 1/2} }, }, selection_box = { type = "fixed", fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, }, - inventory_image = "BushBranchesCenter.png", + inventory_image = "BushBranchesCenterLeaves"..TexNum..".png", paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, - groups = {tree=1, snappy=3, flammable=2, leaves=1}, + groups = { + -- tree=1, -- MM: disabled because some recipes use group:tree for trunks + snappy=3, + flammable=2, + leaves=1 + }, + sounds = default.node_sound_leaves_defaults(), + }) +end + +local BushBranchSide = { {2,1}, {4,2} } +for i in pairs(BushBranchSide) do + local Num = BushBranchSide[i][1] + local TexNum = BushBranchSide[i][2] + minetest.register_node("bushes:bushbranches"..Num, { + description = "Bush Branches "..Num, + drawtype = "nodebox", + tiles = { + "bush_leaves"..TexNum..".png", + "BushBranchesCenterLeaves"..TexNum..".png", + "BushBranchesSide1Leaves"..TexNum..".png", + "BushBranchesSide1Leaves"..TexNum..".png", + "BushBranchesSide2Leaves"..TexNum..".png", -- MM: We could also mirror the previous here, + "BushBranchesSide2Leaves"..TexNum..".png" -- unless U really want 'em 2 B different + }, + node_box = { + type = "fixed", + fixed = { + {0.137748,-0.491944,0.5,-0.125000,-0.179444,-0.007790}, --NodeBox 1 + {0.262748,-0.185995,0.5,-0.237252,0.126505,-0.260269}, --NodeBox 2 + {0.500000,0.125000,0.500000,-0.500000,0.500000,-0.500000}, --NodeBox 3 + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "BushBranchesSide2Leaves"..TexNum..".png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = { + -- tree=1, -- MM: disabled because some recipes use group:tree for trunks + snappy=3, + flammable=2, + leaves=1 + }, sounds = default.node_sound_leaves_defaults(), }) end @@ -81,7 +97,7 @@ for i in pairs(BushLeafNode) do tiles = {"bush_leaves"..Num..".png"}, inventory_image = "bush_leaves"..Num..".png", paramtype = "light", - groups = { + groups = { -- MM: Should we add leafdecay? snappy=3, flammable=2, attached_node=1 @@ -127,11 +143,25 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type) local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} --local bush_branch_type = math.random(1,3) - local bush_branch_type = 2 - if dir == 5 then + --local bush_branch_type = 2 + + -- MM: I'm not sure if it's slower now than before... + if dir ~= 5 and leaf_type == 1 then + bush_branch_type = 2 + dir = 1 + end + if dir ~= 5 and leaf_type == 2 then + bush_branch_type = 4 + dir = 1 + end + if dir == 5 and leaf_type == 1 then bush_branch_type = 1 dir = 1 end + if dir == 5 and leaf_type == 2 then + bush_branch_type = 3 + dir = 1 + end if minetest.get_node(right_here).name == "air" -- instead of check_air = true, or minetest.get_node(right_here).name == "default:junglegrass" then diff --git a/bushes/textures/BushBranchesCenterLeaves2.png b/bushes/textures/BushBranchesCenterLeaves2.png new file mode 100644 index 0000000000000000000000000000000000000000..2009b503f22fe0cc81d73b246e7445295c8a641c GIT binary patch literal 487 zcmVN2bPDNB8 zb~7$DE-^7j^FlWO00Co3L_t(IPj!+%O9Md^#IMpu3%eBBq!26=#YiG3S|}$R;t3X_ z7!QJ=h@Hd_;l~ms1UnH+K?KwJ5!Rb`{+4(C354C9do%Oq?Iz9hsnEzK!f|^hl)t2# zF4;OcHx~G2c(xKoAMdGfoyE~=h1y6!1O&7f?u+#eTx+r0sT?Iz>!Nh?L`-~lm?pSt zRTnCzP!1}@l~|B10#2T&ZV(}>&b~|L6K4S6volx`g~upmME1$)S~KPa^tT|);}X*u zaf{I1SvHYke?3m#=j1j#Mnn@pjr)e+@x$416W4pt+Rv*28<}Za!S+JzLM}MjxAHuE z9He0C+&b_vj#jG|>D?hezdYr`;eFeLzhg%MNT^GI{YCnJS2Y2gM0^<{98gxZibW?9;ba!ELWdKlNX>N2bPDNB8 zb~7$DE-^7j^FlWO00J#ZL_t(IPnA>4Zqq;%by6v`s#-NH8dQ(t*m*T=d8EXzyxbN? zK#Gtmb2=q}OB_q#}UMKabh@Y|Vub0xnRx?7J0-I}5xdElsN9s_aE%$EnwastFVhLU2+5E!(s z&VrRo3)hM<5P)p2nNRu}c^}$^%+vcuoVB*0q_Fy}YtzUPkPKFU{M~m-dDkGH5Ci5K z;t$>eYjLfZ@Ga>bQ@~|*YuRP&k??H0Ig8aZ#5d2~R?IciFHodc&oUEvVWt2;M^g%& zs@&eQ3#&+UO>+3~*3u;Fou0Q%GUZ$8m(=X9`;MANp|G5h89_(OTBrseJWV9H?5Ux@nXxAMFuKo;;qs|@N311XI!3J9P;{!|bhjqefztw?14C~A zrvd;qFHXl)fP$WVeQsA@_%b9Dzdx{ZWZ+^5FAcNJnft0 za%ih7AU*Tac_57QE8+=N@+YV$+K#sH_d*0n#w4g0KZhe1KVF!CO@tEo)hn;455N8a XYCi5KSyIck00000NkvXXu0mjfD#tap literal 0 HcmV?d00001 diff --git a/bushes/textures/BushBranchesSide2Leaves2.png b/bushes/textures/BushBranchesSide2Leaves2.png new file mode 100644 index 0000000000000000000000000000000000000000..55184a4e584286582b948d07a665f0677276c30e GIT binary patch literal 719 zcmV;=0x<{98gxZibW?9;ba!ELWdKlNX>N2bPDNB8 zb~7$DE-^7j^FlWO00K)%L_t(IPmNMdYZFlveJYBv78)gO>AXoYlS$HAH5JXwWG0ElOC?vuh%h>dl)s%Ava5`kU#{0?m5odDW3nodl#oOO zdT6SzLBi-m41457wy`4Oou#4!`MAU?6Nn^*Gm-%ol1=4%uRePk)zKC(f)xQF+tu#{ zruw_(6;}YH{r39B!dc{W>t{|j>T{lGqiUSOiUN!bTS}SM1W<2P+;>u?(mTpo6@5PLH!`eV<-KDp?cddByovK)cY!`075tRU6AjRS?a66V5G>%JjmK+zJ$2&rIK@KUW$>GevSfnYer705o>R`bSN~H&-ZUs4-?T= z?CMnkcJ*uY3;B`F-^;1o1IB@d>1*uk7icDqi8uB$6ZAR>0VHMQiz-3zY=nTG=M93l zX;6qHL1V0i6?L;|>n;qHfT(+71j}0IwfdUPKj7w8S^0^#M&DgKuZ(8@CnAR@GWn07 zJo77bv_*{RzQ8-~tAAosyGbT~TeGyOeFKMye*wM%_@l&rGVK5W002ovPDHLkV1jk; BP)h&+ literal 0 HcmV?d00001 diff --git a/bushes/textures/BlockBranch1.png b/bushes/textures/old & unused/BlockBranch1.png similarity index 100% rename from bushes/textures/BlockBranch1.png rename to bushes/textures/old & unused/BlockBranch1.png diff --git a/bushes/textures/BlockBranch1L.png b/bushes/textures/old & unused/BlockBranch1L.png similarity index 100% rename from bushes/textures/BlockBranch1L.png rename to bushes/textures/old & unused/BlockBranch1L.png diff --git a/bushes/textures/BlockBranch1R.png b/bushes/textures/old & unused/BlockBranch1R.png similarity index 100% rename from bushes/textures/BlockBranch1R.png rename to bushes/textures/old & unused/BlockBranch1R.png diff --git a/bushes/textures/BushBranches1.png b/bushes/textures/old & unused/BushBranches1.png similarity index 100% rename from bushes/textures/BushBranches1.png rename to bushes/textures/old & unused/BushBranches1.png diff --git a/bushes/textures/BushBranches1sm.png b/bushes/textures/old & unused/BushBranches1sm.png similarity index 100% rename from bushes/textures/BushBranches1sm.png rename to bushes/textures/old & unused/BushBranches1sm.png diff --git a/bushes/textures/BushBranches1sm2.png b/bushes/textures/old & unused/BushBranches1sm2.png similarity index 100% rename from bushes/textures/BushBranches1sm2.png rename to bushes/textures/old & unused/BushBranches1sm2.png diff --git a/bushes/textures/BushBranches1sm3.png b/bushes/textures/old & unused/BushBranches1sm3.png similarity index 100% rename from bushes/textures/BushBranches1sm3.png rename to bushes/textures/old & unused/BushBranches1sm3.png diff --git a/bushes/textures/BushBranches1sm4.png b/bushes/textures/old & unused/BushBranches1sm4.png similarity index 100% rename from bushes/textures/BushBranches1sm4.png rename to bushes/textures/old & unused/BushBranches1sm4.png diff --git a/bushes/textures/BushBranchesCenter.png b/bushes/textures/old & unused/BushBranchesCenter.png similarity index 100% rename from bushes/textures/BushBranchesCenter.png rename to bushes/textures/old & unused/BushBranchesCenter.png diff --git a/bushes/textures/BushBranchesSide1.png b/bushes/textures/old & unused/BushBranchesSide1.png similarity index 100% rename from bushes/textures/BushBranchesSide1.png rename to bushes/textures/old & unused/BushBranchesSide1.png diff --git a/bushes/textures/BushBranchesSide2.png b/bushes/textures/old & unused/BushBranchesSide2.png similarity index 100% rename from bushes/textures/BushBranchesSide2.png rename to bushes/textures/old & unused/BushBranchesSide2.png diff --git a/bushes/textures/moretrees_pine_leaves3.png b/bushes/textures/old & unused/moretrees_pine_leaves3.png similarity index 100% rename from bushes/textures/moretrees_pine_leaves3.png rename to bushes/textures/old & unused/moretrees_pine_leaves3.png