From d72574d28835e30e9d7fa7644268876e6920421a Mon Sep 17 00:00:00 2001 From: Rogier Date: Fri, 1 Jul 2016 16:06:29 +0200 Subject: [PATCH] Add poplar tree Poplars exist in two kinds: small and large trees. Both use the same nodes, except for the sapling. Poplar leaves may drop one or the other sapling. Poplar trees require a humid environment, and water nearby. Provided there is water, an occasional poplar will grow under less humid conditions. --- LICENSE | 5 +- biome_defs.lua | 91 ++++++++++++++++++++ default_settings.txt | 1 + init.lua | 12 +++ node_defs.lua | 40 +++++++++ textures/moretrees_poplar_leaves.png | Bin 0 -> 563 bytes textures/moretrees_poplar_sapling.png | Bin 0 -> 447 bytes textures/moretrees_poplar_small_sapling.png | Bin 0 -> 347 bytes textures/moretrees_poplar_trunk-1.png | Bin 0 -> 1217 bytes textures/moretrees_poplar_trunk.png | Bin 0 -> 980 bytes textures/moretrees_poplar_trunk_top.png | Bin 0 -> 751 bytes textures/moretrees_poplar_wood.png | Bin 0 -> 726 bytes tree_biomes.txt | 1 + tree_models.lua | 31 +++++++ 14 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 textures/moretrees_poplar_leaves.png create mode 100644 textures/moretrees_poplar_sapling.png create mode 100644 textures/moretrees_poplar_small_sapling.png create mode 100644 textures/moretrees_poplar_trunk-1.png create mode 100644 textures/moretrees_poplar_trunk.png create mode 100644 textures/moretrees_poplar_trunk_top.png create mode 100644 textures/moretrees_poplar_wood.png diff --git a/LICENSE b/LICENSE index 7cffc99..ecc5c14 100644 --- a/LICENSE +++ b/LICENSE @@ -7,13 +7,14 @@ All source code: Date & cocos palm code (date_palm.lua, cocos_palm.lua) © 2016, Rogier Published under the terms and conditions of the WTFPL. -All date & date palm textures, date-based food, cocos flower & green coconuts: +All date & date palm textures, date-based food, cocos flower & green coconuts, +and all poplar textures: © 2016, Rogier Published under the terms and conditions of CC-BY-SA-3.0 Unported. - Three of the date palm textures are modifications of existing moretrees textures - The green coconuts are a modification of the brown coconut - The date cake batter is a modification of the acorn muffin batter -All sapling textures (textures/*_sapling.png): +All other sapling textures (textures/*_sapling.png): © 2013, Tim Huppertz Published under the terms and conditions of CC-BY-SA-3.0 Unported. All other textures: diff --git a/biome_defs.lua b/biome_defs.lua index 46228f5..463f4b8 100644 --- a/biome_defs.lua +++ b/biome_defs.lua @@ -196,6 +196,97 @@ moretrees.cedar_biome = { max_count = 10, } + +-- Poplar requires a lot of water. +moretrees.poplar_biome = { + surface = "default:dirt_with_grass", + avoid_nodes = moretrees.avoidnodes, + avoid_radius = 6, + seed_diff = 341, + min_elevation = 0, + max_elevation = 50, + near_nodes = {"default:water_source"}, + near_nodes_size = 15, + near_nodes_vertical = 5, + near_nodes_count = 1, + humidity_min = -0.7, + humidity_max = -1, + rarity = 50, + max_count = 15, +} + +-- The humidity requirement it quite restrictive (apparently). +-- Spawn an occasional poplar elsewhere. +moretrees.poplar_biome_2 = { + surface = "default:dirt_with_grass", + avoid_nodes = moretrees.avoidnodes, + avoid_radius = 6, + seed_diff = 341, + min_elevation = 0, + max_elevation = 50, + near_nodes = {"default:water_source"}, + near_nodes_size = 15, + near_nodes_vertical = 4, + near_nodes_count = 10, + humidity_min = 0.1, + humidity_max = -0.6, + rarity = 50, + max_count = 1, +} + +-- Subterranean lakes provide enough water for poplars to grow +moretrees.poplar_biome_3 = { + surface = "default:dirt_with_grass", + avoid_nodes = moretrees.avoidnodes, + avoid_radius = 6, + seed_diff = 342, + min_elevation = 0, + max_elevation = 50, + near_nodes = {"default:water_source"}, + near_nodes_size = 1, + near_nodes_vertical = 25, + near_nodes_count = 1, + humidity_min = -0.5, + humidity_max = -1, + rarity = 0, + max_count = 30, +} + +moretrees.poplar_small_biome = { + surface = "default:dirt_with_grass", + avoid_nodes = moretrees.avoidnodes, + avoid_radius = 4, + seed_diff = 343, + min_elevation = 0, + max_elevation = 50, + near_nodes = {"default:water_source"}, + near_nodes_size = 10, + near_nodes_vertical = 5, + near_nodes_count = 1, + humidity_min = -0.7, + humidity_max = -1, + rarity = 50, + max_count = 10, +} + +moretrees.poplar_small_biome_2 = { + surface = "default:dirt_with_grass", + avoid_nodes = moretrees.avoidnodes, + avoid_radius = 4, + seed_diff = 343, + min_elevation = 0, + max_elevation = 50, + near_nodes = {"default:water_source"}, + near_nodes_size = 10, + near_nodes_vertical = 4, + near_nodes_count = 5, + humidity_min = 0.1, + humidity_max = -0.6, + rarity = 50, + max_count = 3, +} + + moretrees.fir_biome = { surface = "default:dirt_with_grass", avoid_nodes = moretrees.avoidnodes, diff --git a/default_settings.txt b/default_settings.txt index 0a5fc88..257baec 100644 --- a/default_settings.txt +++ b/default_settings.txt @@ -15,6 +15,7 @@ moretrees.enable_birch = true moretrees.enable_spruce = true moretrees.enable_jungle_tree = true moretrees.enable_fir = true +moretrees.enable_poplar = true moretrees.enable_beech = false -- set this to true to make moretrees spawn saplings at mapgen time instead diff --git a/init.lua b/init.lua index 2c50fd9..8189ffd 100644 --- a/init.lua +++ b/init.lua @@ -97,6 +97,8 @@ if moretrees.spawn_saplings then moretrees.spawn_jungletree_object = "moretrees:jungletree_sapling_ongen" moretrees.spawn_fir_object = "moretrees:fir_sapling_ongen" moretrees.spawn_fir_snow_object = "snow:sapling_pine" + moretrees.spawn_poplar_object = "moretrees:poplar_sapling_ongen" + moretrees.spawn_poplar_small_object = "moretrees:poplar_small_sapling_ongen" else moretrees.spawn_beech_object = moretrees.beech_model moretrees.spawn_apple_tree_object = moretrees.apple_tree_model @@ -113,6 +115,8 @@ else moretrees.spawn_jungletree_object = "moretrees.grow_jungletree" moretrees.spawn_fir_object = "moretrees.grow_fir" moretrees.spawn_fir_snow_object = "moretrees.grow_fir_snow" + moretrees.spawn_poplar_object = moretrees.poplar_model + moretrees.spawn_poplar_small_object = moretrees.poplar_small_model end if moretrees.enable_beech then @@ -175,6 +179,14 @@ if moretrees.enable_fir then end end +if moretrees.enable_poplar then + biome_lib:register_generate_plant(moretrees.poplar_biome, moretrees.spawn_poplar_object) + biome_lib:register_generate_plant(moretrees.poplar_biome_2, moretrees.spawn_poplar_object) + biome_lib:register_generate_plant(moretrees.poplar_biome_3, moretrees.spawn_poplar_object) + biome_lib:register_generate_plant(moretrees.poplar_small_biome, moretrees.spawn_poplar_small_object) + biome_lib:register_generate_plant(moretrees.poplar_small_biome_2, moretrees.spawn_poplar_small_object) +end + -- Code to spawn a birch tree function moretrees.grow_birch(pos) diff --git a/node_defs.lua b/node_defs.lua index b1df5f7..1c0796b 100644 --- a/node_defs.lua +++ b/node_defs.lua @@ -12,6 +12,8 @@ moretrees.treelist = { {"date_palm", "Date Palm Tree", "date_palm_fruit_trunk", "Date Palm Tree", {0, 0, 0, 0, 0, 0}, 0.0 }, {"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"cedar", "Cedar Tree", "cedar_cone", "Cedar Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, + {"poplar", "Poplar Tree"}, + {"poplar_small", "Poplar Tree"}, {"willow", "Willow Tree"}, {"rubber_tree", "Rubber Tree"}, {"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, @@ -72,6 +74,7 @@ for i in ipairs(moretrees.treelist) do if treename ~= "jungletree" -- the default game provides jungle tree, acacia, and pine trunk/planks nodes. and treename ~= "acacia" + and treename ~= "poplar_small" and treename ~= "pine" then saptex = "moretrees_"..treename.."_sapling.png" @@ -273,6 +276,43 @@ for i in ipairs(moretrees.treelist) do end end +-- Add small poplar saplings + +local poplar_sapling = minetest.registered_nodes["moretrees:poplar_sapling"] +local poplar_sapling_ongen = minetest.registered_nodes["moretrees:poplar_sapling_ongen"] +local poplar_small_sapling = {} +local poplar_small_sapling_ongen = {} +for k,v in pairs(poplar_sapling) do + poplar_small_sapling[k] = v +end +for k,v in pairs(poplar_sapling_ongen) do + poplar_small_sapling_ongen[k] = v +end +poplar_small_sapling.tiles = {"moretrees_poplar_small_sapling.png"} +poplar_small_sapling.inventory_image = "moretrees_poplar_small_sapling.png" +poplar_small_sapling_ongen.tiles_ongen = {"moretrees_poplar_small_sapling.png"} +poplar_small_sapling_ongen.inventory_image_ongen = "moretrees_poplar_small_sapling.png" +poplar_small_sapling_ongen.drop = "moretrees:poplar_small_sapling" +minetest.register_node("moretrees:poplar_small_sapling", poplar_small_sapling) +minetest.register_node("moretrees:poplar_small_sapling_ongen", poplar_small_sapling_ongen) +if moretrees.spawn_saplings then + table.insert(moretrees.avoidnodes, "moretrees:poplar_sapling") + table.insert(moretrees.avoidnodes, "moretrees:poplar_small_sapling_ongen") +end + +local poplar_leaves_drop = minetest.registered_nodes["moretrees:poplar_leaves"].drop +minetest.override_item("moretrees:poplar_leaves", { + drop = { + max_items = poplar_leaves_drop.maxitems, + items = { + {items = {"moretrees:poplar_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity }, + {items = {"moretrees:poplar_small_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity }, + {items = {"moretrees:poplar_leaves"} } + } + } +}) + + -- Extra nodes for jungle trees: local jungleleaves = {"yellow","red"} diff --git a/textures/moretrees_poplar_leaves.png b/textures/moretrees_poplar_leaves.png new file mode 100644 index 0000000000000000000000000000000000000000..64568bc8019b9abec180e8ed2df82ea5e8769380 GIT binary patch literal 563 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZQx&@Ck7R(h_+R#+}A$)oL2G8cO9#I!!t{4LWAs zW~x=Hrk$p`O}eVpss^nFT6J3LHR>jvCPp1bYBg$d#d4Z;no4C#`px<}jXGNOS_Ul! zM(sx0_1e<;(w2Re3Z)8q&3YES7Un(Xl6jJLlkJ2vgf(h3tR`4V?NMQuIvxknRu*4XPpV>0}37Uba4!kxGdUt)9H|bhztKh%_$zj-q{ANEFnvD7VUWW z?f?C!Z(pC8$;y^BBlFWmiLTC_NoTffnW9%56MQynmh=~aJ#&k_GZw}P9Em<>+-NGW zS9$HVAJ*?aPFWEX^4a0wF(>0jMs2yrJXfY{d3$7?koD1d&l;@XsoW5a*5Ug*Wkr>e z1@q~cKsig>%UW?MZ*yeqPIAX3vvzL(aIXD5w4LWAsW+t5`8nqgdd6GJf zI_fp*a>a6b&3cx7md2gNT6J0}X{n)cQDWI*Ditb9WlAY&DL($5$`#7yJ?2t*Ql+KE zMY&malkJ2vgms&AQ&VFD{9QC^G!#k|!Xg6`lHv?n4dhDXJp8>QW1^JGm9!hQQ?k-y z;-ht%bfV*9gCfJiV?yIn)BgYe|3)~n0_ZZvk|4ie28U-i(m;O zkH}&M25un`X1sK_?hjCqy~NYkmHh!blQ<`9RYiOkP^iq)#W6(Ua&kfggPR&#$bmCW zr_xiCQ{4q0JV<%u^sM-^!N!kD*^eGS5Pu-(A|xOrCMf#YRY+j^gegMP+=M1foH{xD zfs0VUlc1nyp^iciM1@5K#hip5goFlPzW`MKMDW4$2hL?PXH471w<^8l>xG)t`3$KH Z42j&Vk2JO{0fsgMgQu&X%Q~loCIDF$ig5q{ literal 0 HcmV?d00001 diff --git a/textures/moretrees_poplar_small_sapling.png b/textures/moretrees_poplar_small_sapling.png new file mode 100644 index 0000000000000000000000000000000000000000..fb9bd03078fcd3e6c90c8b6c52342096de2f019d GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZJqX_=LCuX`>D!t$Hn;1|73*Gm}mejam)KJV~8K z9rYS@xnjAn$iRf8IO9%ZhXSQ6wH%;50sMjD8d;3=**-JcqUD+S7Gx1o9&N>s$2NZJkba4!kxSX7@Krtc3NjM?R z@#*GG8#gWHC@3&0T*y&S`1!*kjt?KXITmqnaCUbr;^^q~E?AH?ampmOt>JEBXA_G) b1+X#n&SsMMzB2MY&_D)HS3j3^P6y_T(NSVRG_80h87V3#Bu;=4uBJaL>~qKTLr)o2!J(302bN?_ejm&-7dQl?#|~6xmYI7$E-$uw-y@PIvl2{wzf?MRPATTY;QcuPzVYe zjl$GA4T|KmxojfsbvxTT#3V^fj*QrChKA-Ezt3Z|AOVIdW>PMftyLlQdNH%zS}v5* z$&6Z~XqAhHwhRpxi`wqaCRt-L6_4^^httxZOWCYwr&h&s9EQ0{`F=m;leCHK4*SH& zc!(CZ+bmbMmdeFKUk39yOZ^2e?t+YlK#=j^o&bS6oYn?OJ;#OnGkr8kwRcHT3)u&3#z~x^eQHFfH(4Sq zCy|T7Y{+G|wa6vWD4*_4v?-)COQ(3YHxbe5lx~kZo6R6*Bgt@>%hA#<$t5yoQx9T7 z2TKD?kXGs;Cd|eoTsjtMQ^;%t8K9X~Wk)obrYK5hfXn%!rW>-k9NWjY2WUUkqtE2C zBZnC!e}u@*$4#dD2ACFnWRX0ccT@02kyX4Z#E?<7diYu?W z`kIy3UI$iPf5VM8t-kq|TW?#lcHQlF+zHlisJW}Q?(X`A#*LerM9rIlSkfYuwYJII zI~1K=N|hQw8m+Dy)+4B)$7nKJtiWb>I9-_AKmP(8`tqx8V|DBq>I#6wL?=uL_fyTP#+TAr!@P7$m6d?cr literal 0 HcmV?d00001 diff --git a/textures/moretrees_poplar_trunk.png b/textures/moretrees_poplar_trunk.png new file mode 100644 index 0000000000000000000000000000000000000000..47672fb9a555b739a9520f88843aa1bcc35aaf02 GIT binary patch literal 980 zcmV;_11tQAP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw0006gP)t-sYiDPEcX@z#dRkgj zX=PxPjg4?`YD`f_gMNIKi;7`nV3m}XU}a;7gN1x_c2ZYSdUbM?j*W0{Ygb%Ve0+JD zlaWnIK!%8kZEtUbfPr;zZcDbwlah>(cy@DGSx|d>dZ(hIad2r!PC|ZtcWZ8E ze}R0Mk&c>{nUIZ zU}j!`fPILAgJNM_XliJjo0?)}Tzh_apPrb1fqQ0bZij<}QCCfdgN1Z)aEXbCkdKU3 zT2p|7fR2cRkBo4nv|GubaJSrsDFTdU}|QOl#+XUcw1s$mXnx`kBn<>Yl(x0e1U#EN5x zPe@EkPDxEm&&UL^vKX>+a`W;F3X6(MN004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw0003{P)t-sQB_oacX@z#dRkgj zX=PxPjg4?`YD`f_gMNIKi;8=BbyQbQXlG(|adKN;U6zo9dv$4&i+-M&j-Q&3u&bh} zq?@Ormz|i6g?@2)b7y8@R&HrtR9H}5Wn_?veA3I6+t#hy)vMUjq}tS|-Po?z(W7u{ zU}R`zVQ6QOiha+>lGM$e)6JR7!-j@`a%X5|ZEfpu_hQc+2hjE;qUdvkAWU13^zd3K?hnU05q ziinAJba8rndjJ3b^7z$600001VoOIvZ&e6kfdBvi32;bRa{vGf5&!@T5&_cPe*6Fc z00(qQO+^Rb2LcQ`6`IUf4gdfE`AI}UR2b6@j#oPaK@>o*UZN(F%_3&*?2O11WC=1s zuvk{~-g__q|IxgkbG`%6)ZEhA*51+C)t&0;g%tGl4-BR=L)n~{&-=q8qfi(l6dA(+ zk#jL#gozRjq|(L^B{-j)g6T3314@x{2T*SYW-HV%iApfR8J(Mlg$h=sbv_alSX+dp zav%dEtWX9OF4tjYRjer@t;49sXdN~-nPiseSQ{thwqV=GkR`-ccL;{q*oD1)R}gWm zl@JUM4&msS34M}SV-kYAbP8wZ7m5%fW$gZqe+gIDH@A0Ql#LqcOzqx(fXAojm)E!V hkI%2~;?Hm4?;mcIEz9jEwa5Sf002ovPDHLkV1idzO4k4Y literal 0 HcmV?d00001 diff --git a/textures/moretrees_poplar_wood.png b/textures/moretrees_poplar_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..55e6b44ef59201f5a2e2077f6a54a71a8f1bd095 GIT binary patch literal 726 zcmV;{0xA88P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw0003yP)t-sp_5*%pJ|+rTC}Hc zt)g?Sn{>CSbe)o1s-9}IsB^8OaJQ{_uA*6tjWNg%EO|^zn#Ij zke-=q#Jrcry_uhqT&9 zxUPD|y_d$mo5{eQvZ;5`%B-)Xcht_a*U`DLpK+<2WU8HHqm^H;p>M06W}=mBv!!sH zmtUrtWw57vshw%Bqi(USbg`j)pqYBu(z>*&e5svin~qqmpK6_uU9XjMte08wR0004E zOGiX#%WU)_00009a7bBm000XT000XT0n*)m`~Uy|2XskIMF-#q0t`D9n#@-Y0002> zNkl5J2J4*y}JmvWsCM3q%uJ?2$z@_TDx2-roNWjOX(I4nSLbp`){_ zyQjCWe_(KE7|qiQqec!Jn_JsEyLKd>3cO8@`>07*qo IM6N<$f;rw|`2YX_ literal 0 HcmV?d00001 diff --git a/tree_biomes.txt b/tree_biomes.txt index 22e1032..0dd0345 100644 --- a/tree_biomes.txt +++ b/tree_biomes.txt @@ -18,6 +18,7 @@ willow - 5 to + 5 n/a water, 15 5 dirt_with grass 337 20 acacia n/a n/a n/a n/a dirt_with_grass, desert_sand n/a 15 rubber - 5 to + 5 above +32 water, 15 10 dirt_with_grass 338 20 +poplar n/a -10 to +26 water, 15h,5v 1 dirt_with_grass 341,342,343 10 beech n/a n/a n/a n/a dirt_with_grass 2 10 diff --git a/tree_models.lua b/tree_models.lua index 791bddb..9372fe9 100644 --- a/tree_models.lua +++ b/tree_models.lua @@ -43,6 +43,37 @@ moretrees.oak_model={ fruit_chance=3, } +moretrees.poplar_model={ + axiom="TTTaaBCCCCCCCCCCCcccBBB[[f]&&G++f++Gf++Gf++Gf++G--]G[[f]&&G++f++Gf++Gf++Gf++G--]Gff", + rules_a="T", + rules_b="[[T]&&G++f++ff++ff++ff++f--]G", + rules_c="[[T]&&G++f++ff++ff++ff++f--G++[d]G[d]G++G[d]G[d]G[d]G++G[d]G[d]G[d]G++G[d]G[d]G[d]G++G[d]G]G", + rules_d="f", + trunk="air", + trunk="moretrees:poplar_trunk", + leaves="moretrees:poplar_leaves", + angle=45, + iterations=0, + random_level=0, + trunk_type="single", + thin_branches=false, +} + +moretrees.poplar_small_model={ + axiom="TT[T]BCCCCccBBff", + rules_a="T", + rules_b="[[f]&&G++f++Gf++Gf++Gf++G--]G", + rules_c="[[T]&&G++f++[d]Gf++[d]Gf++[d]Gf++[d]G--]G", + rules_d="f", + trunk="moretrees:poplar_trunk", + leaves="moretrees:poplar_leaves", + angle=45, + iterations=0, + random_level=0, + trunk_type="single", + thin_branches=false, +} + moretrees.sequoia_model={ axiom="FFFFFFFFFFddccA///cccFddcFA///ddFcFA/cFFddFcdBddd/A/ccdcddd/ccAddddcFBcccAccFdFcFBcccc/BFdFFcFFdcccc/B", rules_a="[&&&GGF[++^FFdd][--&Fddd]//Fdd[+^Fd][--&Fdd]]////[&&&GGF[++^FFdd][--&Fddd]//Fdd[+^Fd][--&Fdd]]////[&&&GGF[++^FFdd][--&Fddd]//Fdd[+^Fd][--&Fdd]]",