From 8c858253f165836299412952421a16b459625248 Mon Sep 17 00:00:00 2001 From: Pyritie Date: Mon, 15 Sep 2025 04:32:00 +0100 Subject: [PATCH] proper mars rock layers (#1829) * rock layer stuff for the next kjs-tfc release * fix mars sea level * mob tweaks * lookin cool joker * desaturated the amaranita mushrooms * desaturated purple polypore * features for the "bush" trees so they're always placed touching a log * moved these out of the forest so it's less crowded * upd8 * moved these to OCEAN_FLOOR * moved the bushes to normal features instead of forests * attached plants, bush adjustments * updates with new gravel * disable tinting on fallen leaves --- .../textures/block/amaranita_fur.png | Bin 171 -> 285 bytes .../textures/block/amaranita_stem_middle.png | Bin 173 -> 351 bytes .../textures/block/amaranita_stem_roots.png | Bin 183 -> 379 bytes .../textures/block/amaranita_stem_top.png | Bin 156 -> 320 bytes .../block/large_amaranita_cap_bottom.png | Bin 212 -> 456 bytes .../block/large_amaranita_cap_side.png | Bin 215 -> 452 bytes .../block/large_amaranita_cap_top.png | Bin 213 -> 384 bytes .../textures/block/purple_polypore.png | Bin 610 -> 635 bytes .../block/small_amaranita_mushroom.png | Bin 237 -> 464 bytes kubejs/data/ad_astra/dimension/mars.json | 6 +- .../tfg/worldgen/biome/mars/amber_edge.json | 6 - .../biome/mars/martian_mountains.json | 2 +- .../worldgen/biome/mars/martian_river.json | 2 +- .../worldgen/biome/mars/rusticus_edge.json | 6 - .../tfg/worldgen/biome/mars/sangnum_edge.json | 6 - .../mars/crop/amber_root.json | 2 +- .../mars/crop/blossom_berry.json | 2 +- .../mars/crop/bolux_mushroom.json | 2 +- .../mars/crop/cave_pumpkin.json | 2 +- .../mars/crop/chorus_mushroom.json | 2 +- .../mars/crop/shadow_berry.json | 2 +- .../mars/surface/aurant_polypore.json | 18 ++ .../mars/surface/bulb_moss.json | 18 ++ .../mars/surface/filalux_wings.json | 18 ++ .../mars/surface/filalux_wings_top.json | 43 +++ .../mars/surface/purple_polypore.json | 18 ++ .../mars/tree/cave_bush.json | 44 +++ .../mars/tree/lucernia.json | 44 +++ .../worldgen/noise_settings/mars_noise.json | 60 ++++- .../worldgen/noise_settings/moon_noise.json | 2 +- .../placed_feature/mars/crop/amber_root.json | 2 +- .../mars/crop/blossom_berry.json | 2 +- .../mars/crop/bolux_mushroom.json | 2 +- .../mars/crop/cave_pumpkin.json | 2 +- .../mars/crop/chorus_mushroom.json | 2 +- .../mars/crop/shadow_berry.json | 2 +- .../mars/semiheavy_ammoniacal_water.json | 2 +- .../placed_feature/mars/surface/aeridium.json | 2 +- .../mars/surface/amber_grass.json | 2 +- .../mars/surface/aurant_polypore.json | 23 ++ .../mars/surface/bulb_moss.json | 23 ++ .../mars/surface/cave_grass.json | 2 +- .../placed_feature/mars/surface/clawfern.json | 2 +- .../mars/surface/feather_patch_glider.json | 2 +- .../mars/surface/feather_patch_wraptor.json | 2 +- .../mars/surface/filalux_wings.json | 23 ++ .../mars/surface/filalux_wings_top.json | 23 ++ .../mars/surface/flammalix.json | 2 +- .../mars/surface/flint_patch.json | 2 +- .../mars/surface/globulagus.json | 2 +- .../mars/surface/lamellarium.json | 2 +- .../mars/surface/lanceleaf.json | 2 +- .../mars/surface/lanceleaf_small.json | 2 +- .../surface/large_amaranita_mushroom.json | 4 +- .../mars/surface/lucernia_outer_leaves.json | 2 +- .../placed_feature/mars/surface/lutebus.json | 2 +- .../placed_feature/mars/surface/orango.json | 2 +- .../mars/surface/pitcher_plant.json | 2 +- .../mars/surface/purple_polypore.json | 23 ++ .../mars/surface/rotten_flesh_patch.json | 2 +- .../placed_feature/mars/surface/ruscus.json | 2 +- .../surface/small_amaranita_mushroom.json | 5 +- .../mars/surface/torchflower.json | 2 +- .../mars/terrain/basalt_delta.json | 2 +- .../mars/terrain/clay_disc.json | 2 +- .../mars/terrain/gabbro_delta.json | 2 +- .../mars/terrain/kaolin_clay_disc.json | 2 +- .../mars/terrain/peat_disc.json | 2 +- .../mars/terrain/red_granite_delta.json | 2 +- .../placed_feature/mars/tree/cave_bush.json | 24 ++ .../placed_feature/mars/tree/lucernia.json | 24 ++ kubejs/server_scripts/ad_astra/tags.js | 18 ++ kubejs/server_scripts/tfg/events.chunks.js | 253 ++++++++++++------ kubejs/server_scripts/tfg/events.forests.js | 63 ++--- kubejs/server_scripts/tfg/tags.js | 8 + kubejs/startup_scripts/betterend/blocks.js | 4 +- .../startup_scripts/tfc/register_climates.js | 14 +- 77 files changed, 698 insertions(+), 203 deletions(-) create mode 100644 kubejs/data/tfg/worldgen/configured_feature/mars/surface/aurant_polypore.json create mode 100644 kubejs/data/tfg/worldgen/configured_feature/mars/surface/bulb_moss.json create mode 100644 kubejs/data/tfg/worldgen/configured_feature/mars/surface/filalux_wings.json create mode 100644 kubejs/data/tfg/worldgen/configured_feature/mars/surface/filalux_wings_top.json create mode 100644 kubejs/data/tfg/worldgen/configured_feature/mars/surface/purple_polypore.json create mode 100644 kubejs/data/tfg/worldgen/configured_feature/mars/tree/cave_bush.json create mode 100644 kubejs/data/tfg/worldgen/configured_feature/mars/tree/lucernia.json create mode 100644 kubejs/data/tfg/worldgen/placed_feature/mars/surface/aurant_polypore.json create mode 100644 kubejs/data/tfg/worldgen/placed_feature/mars/surface/bulb_moss.json create mode 100644 kubejs/data/tfg/worldgen/placed_feature/mars/surface/filalux_wings.json create mode 100644 kubejs/data/tfg/worldgen/placed_feature/mars/surface/filalux_wings_top.json create mode 100644 kubejs/data/tfg/worldgen/placed_feature/mars/surface/purple_polypore.json create mode 100644 kubejs/data/tfg/worldgen/placed_feature/mars/tree/cave_bush.json create mode 100644 kubejs/data/tfg/worldgen/placed_feature/mars/tree/lucernia.json diff --git a/kubejs/assets/betterend/textures/block/amaranita_fur.png b/kubejs/assets/betterend/textures/block/amaranita_fur.png index ba1cf0c8ba359ef7e873b7d8153266d2b189d71c..082a08fbd72fcac4cf4067f1b93aa85658f4e8f2 100644 GIT binary patch delta 269 zcmZ3@IG1UHWIY=L1B3kM|A`C?44efXk;M!Q+`=Ht$S`Y;1Oo%Zc~2L|5R2Zo{)T+b z1_H%O+Z38+ERfU^JHi|=^Edyz>-8n?_yw$+I7MBam+T6jbxEmo-E@_2H=lQSS8qOS zrN}MJ^O}XBrrc6~iRWTdh65SBIzB(%6~CL=%9(v>#SGW_dgg^jmc=6X&Kvu+E2ju9 zJ!BfD=5Bx9=EdVVQ=7IZd9{`tUAD&Z%!(QNAI|bvynTtH*$N5YNbdbJyOq3H&$7QW z6TfS8>tA6#=Qrny4bg79MGIu3b{}WGzbeo4v*Pv>Yu!R_uaKzgHvhc5VJ~a_pAL29 Z^T9&bze?|6U|?YIbY=5%S?83{1ORWdZWI6j delta 154 zcmbQsw3=~(WIZzj1A~Sxe=q|B1Al-|h${mF!}YH(cfGke_x_ottGf=Y{^ZNRz`$4% z@F(je$oD7+4JFe*RnDGoAAS)1`T)Yb&=-o-}Dyut4}t z+lPAVXY=jzFhAw~a#pyFK{SWije~r4KPTGvU;krOneb`-KE_kR>vaDMX8saoU|?YI MboFyt=akR{00pH!#{d8T diff --git a/kubejs/assets/betterend/textures/block/amaranita_stem_middle.png b/kubejs/assets/betterend/textures/block/amaranita_stem_middle.png index af2df081d86090236d8576c43a575491e3c74c96..5259795de72653a646ab194bbeb1fe0d96182329 100644 GIT binary patch delta 335 zcmZ3>c%Ny4WIY=L1B3kM|A`C?44efXk;M!Q+`=Ht$S`Y;1Oo%3pr?yth(&MjWW&5> z2N4%}MH7zGGx#+1*2E}=drY))dZd)uc_uPQL2>>8b&t7fUXLg7bu?{r%n1H#x=nnx z=EZZj=l-l=@80%%?zeEeLV=H;OA|ImGJW{=<X_(xd_I}Nmfa5In$0frZjAhH`rpE_d>Gx>Q(jig0WMKt{wlrTx@fe z$ouo_KYOv9IQ8gA&hA>F2~%6AUF^KcYsvoSL*doa1SP^(#m@xo($ z@nQytyJmV9>IHw8KkVMDbo|){ekU1$4KpsXhyR@JJ4r#TzV^R`;r8O~tno41eHHdi zbxt_IEHe97QoSD=+n$tH+YWxMIk;mM%d(XMt~z!9|GZfD+}q%PUG*I9$t*0h5ARcU zt*BZzXGXP}>x$cKr;pkw2=22Gy^*(7EJh|cGPjCJtoZ+*iH1K<)@$)gGW=mWCVBFU UU1I!t1_lNOPgg&ebxsLQ0M&4tfdBvi delta 166 zcmey(w4HH+WIZzj1A~Sxe=q|BgHV7^h${mFL&e6mm4`PrUEMYJ{+V5GZvIT*Zed_x zU@Qsp3ubV5b|Z~}fg#w_#WAGfR_Iwnz5@PR2lvM4VO>h5If0Es5x<)YSvD8wxCtZ#k=I@dJtDUZIxwawg*;Jbi Y-HZtjoef197#J8lUHx3vIVCg!0H6Fp^#A|> diff --git a/kubejs/assets/betterend/textures/block/amaranita_stem_top.png b/kubejs/assets/betterend/textures/block/amaranita_stem_top.png index f4499f4e6ea36f172fca9ba16d59421dcc357d13..1635f89efc9cfb9a48d25391b16dd7d1f55fa295 100644 GIT binary patch delta 304 zcmbQkcz|hwWIY=L1B3kM|A`C?44efXk;M!Q+`=Ht$S`Y;1Oo%ZCr=m05R2Zo6Akm4 z9RytE3-7Giko020f{qnA9cwj6Q2Bs9}Z+|g-W@DHw?O;Zm|+t%FMw9GLh_(r!v zUhpq-Yir~G+5dR%6dblcP<*g#|7NX#KQ*<%X*=0J{QH?$uWbLMz~W? zVCwj!eT4&KK-$jbOs-GbbG}>euBve;=WTxJK6|ml%%}Gfs!Fc+w5%+cb;PBvV~f$G zbg^Y}Ut0}gXKYEY&ikUdTH8XTG*$fd(@OER1~cZpydQh`q4?451gTe~DWM4fS0syr delta 139 zcmX@WG>375WIZzj1A~Sxe=q|B1Al-|h${mF!`%C4ny&7uJiM`DUH>I97HWgJSD{^iY)V$O7AI7I2W~=nfogj>-6Sg>4!do z<##S?rOZk#fBygb|Map4^8=ZGy!h_#d!IcaTEwJwer{krL&CYY2Ic3wUDxJKn)S5v z{P*xV8yvZIEbI=O^=1##lvf-FDvU&h*jF?#PAZ#yqub+F?#%}i>|L>G*TU$H&lqy%O4Yq*idZ>UAg$eYtwO>T&yKwuYfb!a2ymAM zPr1?UF;&g_4eN@j)5Pn;v((F*c2KhZqs$Kn zyx!h;va{sSgu>8%u13X;e~-tp#2r~NnIm&o-2bQ*TP}WIdVRLd^K85IR}QI}uF?{l z_4K5elIP2v9kXr3H@%)mdKI;Vst08hKj ANdN!< delta 195 zcmX@Xe1&m>WIZzj1A~Sxe=q|BgIs`5h${mF!_D9CcD=bd_x_ottGg->Z>-q3_KBj> zX;szD($XH5j|CYR7#K@}{DK)Ap4~`eU|>k`ba4!+U}QbGF;T*ihsE&BOX2VFYm^IF z85mCN&y;-fKmGO^RsHj3+lzP0@|PJKe=ZSwd+k%^(q%pEm%rG=rOW-a-8}bWz?;0d z%4u~$Yku;qR;|$buB|yQE`QnT>HT%z4stLs)R)9N$}IBC^5v6rX9DebMX*vqT+!|B`7ax{*HXs7lt- zHMVlACus(r*kDz?`*$|))}YHx6Xwq5zLeo)`6m0o;ggc`pLeRAjC?hTVR@vFl&?Yd zd@Cxej+EJ!m3?QB;BEiG&K`C2?_J%q zek-=LI_jUuy?$9yPwalxq3SQ&wk^NNa{H^qm!_C#gM*uOSbr4HPu1M^T5s*sAf}8m uCsl@quP$K4`IrBizVXEach+dSWic=?FnGH9xvX|nWpgU*@Z=M z%k5dp(#z8R)u%DlyD)v&6nFlfC4*B>#d8irCWW%b8;tdN<-1iTyVuQP+_7(u)h_$5 z3x6;eoMa68y4owinPI;a-Io6Ty6?JD*eb7zzZI9$+DtBH8k~)}W3T^2=2xDk zqlss#{aKUBjR|SZx>-Sf0b!=A-?lya*r%qSaomwPcY{j&o5qaIReOuKC>?irH#1_!>`14Evti(^OyqwT?sf=q@yEC;ynWi<%>U~`b;I*^{kJ}HT} z`A$8j%Z6_IkGI}gUtE#bbHuR3E%H&oIR)`qyY}nbD$f15C(F($>)M5V3dh8!awl#7 z?5uWc$NY!;3V7ab%w9Ni)3Id7o`+__o09YUkDM3Rt&+`XWhv2TU|?YIboFyt=akR{ E01g08UjP6A diff --git a/kubejs/assets/betterend/textures/block/purple_polypore.png b/kubejs/assets/betterend/textures/block/purple_polypore.png index 4f4406101becb29b92bc084efd0334dfe358c556..424b94487c4128334eb41043501c3052070102ad 100644 GIT binary patch delta 621 zcmaFF@|$IXWIY=L1B3kM|A`C?44efXk;M!Q+`=Ht$S`Y;1Oo$;uBVG*h(&Mf#M4TUJ+E-Ft0-`ma2Yqxk+|6uO(6&B7VCujSg7cp3XBm;efDqTCb%hQoht@JghhOMqj{mIhVs%i=B{?{}~>q^?Ss2y~wQi z`pEQNb&p}i`^x_xnakqNzPQnH_>XavvGcj@r{hPi*R8H~eR|qem#xRpr1Y%9=@0id%jhQie^!ple0kF@O8V5cdWDU#U1@!x z(*vF!tUiD0)vHInp2m*3U*?_i)w1_7-=P)fuj(_4Q|h$IoW;kEuPqTe`e%FkhNKLw zg>$(7ruxQm-kyCsCpYKe9A)3j*_Gdq%WczR$#sZs4O(ED!MsoOmD7nY0?%do&CSmGHP+^6Euv delta 596 zcmey(@`z=EWIZzj1A~Sxe=q|Bqf3BKi0l9V|Cbn^$l+`L_UZrEkN>}X{Qu>{|IhFK ze|r1>)0_Vv-~9jh`u~U5|KGp-|MuzsH&6b*e)9kIP`I`zr!oM z_U|=&ddT3_BA1WP7tk&7O6_$tBMdVP2#E!7Ago5$dBeK z2^7eV7DKHrOCBcWZ&OV=ha6lnjZ%KDv6&mSwOeo>X}cm zT!NPDLB*V#?|htpZKW=oTT^Mp($&Udx^vxnd^2r+JzQP&@59aX{|XyLbXy-kvQLzl z*`K(dyM4oTp6fH`KTVTTdvlJtx|nn4V`pR2tNyiF#*=1Uuit(mYTAypGpQhddb;|# JtaD0e0sviRCkX%m diff --git a/kubejs/assets/betterend/textures/block/small_amaranita_mushroom.png b/kubejs/assets/betterend/textures/block/small_amaranita_mushroom.png index 51e2a511f246abb3f8828a8ea58c81bd66a7e581..b600047046d4b3cd2c759eadf4f5ab6aa77bc437 100644 GIT binary patch delta 450 zcmaFMc!7C>L_G%^0|SHn=l_We3=EtF9+AZi4BWyX%*Zfnjsyb(W0R+gV~9m>YoM+F zp#Txv^-dX1m$}-G`T1Fe_A+nL={aXKW5+M{3l~e2c#d2wG161{$2eCu_D6w&fEoL7 zHIv2*4wsHCvvrKxt-7FdfRD<%4bh$5>BWWj?!mmZW1ZzIdP(O(I(|- zZ9YE^ooLETxS7GObhzkfx^3IfGlz~|Zz#AunNi{Pn*{+OP3bMw`_JA!VQ-{!nTO@F z!?v59J{vs0XeKWFd1jI12F=rM)#+X*@3&~qV0&h){e$6_at?Rl!kY{KZ2#Sq`QZ7w zz1jlXa+m8(XsRi{|F_^|IV)zPky?R~iJ zecIYt7B^$p9Pq9zShcKq`lku0vo_2SKImP^aA3)OZ;=V9tjpQeuQa~?+2C@r@43U7 z&IXnh&(k}Z+z%;!`?mSSidlShCVi8xdlX;TwNH`3jL#*K=S1K01F>rsT(e&FLqEmu zY6-)ElB|Ot=QNy=kqKYlq`RTFMZ2=P>ciwKp}zebM;`L;P~EpsNo#&Q0|Nttr>mdK II;Vst0Mne%zW@LL delta 221 zcmcb>{FZToL_G^L0|Ud`yN`kx7#I`-d_r6q7#JR&SXFs=W5vd`+xiQ`mrwCn*ycE~ z`irsc6Gf%ds;YP2DKBJTU|=i>@(X5gcy=R=fq|jQ)5S5Qf|2#0Azzb&K- { event.add('tfg:mars_soil', 'tfg:grass/sangnum_kaolin_mycelium') event.add('ad_astra:mars_stone_replaceables', '#tfg:mars_soil') event.add('minecraft:animals_spawnable_on', '#tfg:mars_soil') + event.add('minecraft:animals_spawnable_on', '#tfg:mars_plants') + event.add('minecraft:animals_spawnable_on', '#forge:gravel') event.add('tfc:can_carve', '#ad_astra:moon_stone_replaceables') event.add('tfc:can_carve', '#ad_astra:mars_stone_replaceables') @@ -496,6 +498,8 @@ const registerAdAstraPlacedFeatures = (event) => { event.add('tfg:mars_underground_decoration', "tfg:earth/geode/quartzite") // Vegetation + event.add("tfg:mars_global_small_plants", "tfg:mars/tree/lucernia") + event.add("tfg:mars_global_small_plants", "tfg:mars/tree/cave_bush") event.add("tfg:mars_global_small_plants", "tfg:mars/surface/charnia") event.add("tfg:mars_global_small_plants", "tfg:mars/surface/flamaea") event.add("tfg:mars_global_small_plants", "tfg:mars/surface/lacugrove") @@ -513,6 +517,11 @@ const registerAdAstraPlacedFeatures = (event) => { event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/lanceleaf") event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/lanceleaf_small") + + event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/bulb_moss") + event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/aurant_polypore") + event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/filalux_wings") + event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/filalux_wings_top") event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/amber_grass") event.add("tfg:mars_amber_vegetal_decoration", "tfg:mars/surface/flammalix") @@ -527,6 +536,12 @@ const registerAdAstraPlacedFeatures = (event) => { event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/crop/shadow_berry") event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/lucernia_outer_leaves") + + event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/bulb_moss") + event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/aurant_polypore") + event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/purple_polypore") + event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/filalux_wings") + event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/filalux_wings_top") event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/aeridium") event.add("tfg:mars_rusticus_vegetal_decoration", "tfg:mars/surface/flammalix") @@ -544,6 +559,9 @@ const registerAdAstraPlacedFeatures = (event) => { event.add("tfg:mars_sangnum_vegetal_decoration", "tfg:mars/surface/small_amaranita_mushroom") event.add("tfg:mars_sangnum_vegetal_decoration", "tfg:mars/surface/large_amaranita_mushroom") + + event.add("tfg:mars_sangnum_vegetal_decoration", "tfg:mars/surface/aurant_polypore") + event.add("tfg:mars_sangnum_vegetal_decoration", "tfg:mars/surface/purple_polypore") event.add("tfg:mars_sangnum_vegetal_decoration", "tfg:mars/surface/cave_grass") event.add("tfg:mars_sangnum_vegetal_decoration", "tfg:mars/surface/clawfern") diff --git a/kubejs/server_scripts/tfg/events.chunks.js b/kubejs/server_scripts/tfg/events.chunks.js index 1906d8643..efcc005c8 100644 --- a/kubejs/server_scripts/tfg/events.chunks.js +++ b/kubejs/server_scripts/tfg/events.chunks.js @@ -6,102 +6,183 @@ const $ForestType = Java.loadClass("net.dries007.tfc.world.chunkdata.ForestType" const ROCK_LAYER_HEIGHT = 40; + +// Precompute the aquifer heights as constants as this is not used +let EMPTY_AQUIFER = []; +let aquifer_i = 0; +while (aquifer_i < 16) { + EMPTY_AQUIFER.push(32); + aquifer_i++; +} + + // Bare minimum TFCEvents.createChunkDataProvider('moon', event => { - const emptyLayer = TFC.misc.lerpFloatLayer(0, 0, 0, 0); + const emptyLayer = TFC.misc.lerpFloatLayer(0, 0, 0, 0); - var aquifer = []; - let i = 0; - while (i < 16) { - aquifer.push(32); - i++; - } - var heights = []; - for (let x = 0 ; x < 16 ; x++) { - for (let z = 0 ; z < 16 ; z++) { - heights[x + 16 * z] = 80; - } - } + var heights = []; + for (let x = 0; x < 16; x++) { + for (let z = 0; z < 16; z++) { + heights[x + 16 * z] = 80; + } + } - event.partial((data, chunk) => { - data.generatePartial(emptyLayer, emptyLayer, 0, 0, 0) - }) - event.full((data, chunk) => { - data.generateFull(heights, aquifer) - }) - event.rocks((x, y, z, surfaceY, cache, rockLayers) => { - return rockLayers.sampleAtLayer(0, 0) - }) + event.partial((data, chunk) => { + data.generatePartial(emptyLayer, emptyLayer, 0, 0, 0) + }) + event.full((data, chunk) => { + data.generateFull(heights, EMPTY_AQUIFER) + }) + event.rocks((x, y, z, surfaceY, cache, rockLayers) => { + return rockLayers.sampleAtLayer(0, 0) + }) }) + +let tempLayer = TFC.misc.newOpenSimplex2D(4621678939469) + .octaves(2) + .spread(0.05) + .scaled(-10, 10) +let rainLayer = TFC.misc.newOpenSimplex2D(2846746456346) + .octaves(2) + .spread(0.05) + .scaled(-3, 3) +let forestDensityNoise = TFC.misc.newOpenSimplex2D(98713856895664) + .octaves(4) + .spread(0.0025) + .scaled(-0.2, 1.2) + .clamped(0, 1) +let forestWeirdnessNoise = TFC.misc.newOpenSimplex2D(3210378120) + .octaves(4) + .spread(0.0025) + .map(i => 1.1 * Math.abs(i)) + .clamped(0, 1) + +TFC.misc.register2DNoiseForInspection('temp', tempLayer) +TFC.misc.register2DNoiseForInspection('rain', rainLayer) +TFC.misc.register2DNoiseForInspection('forestType', forestDensityNoise) +TFC.misc.register2DNoiseForInspection('forestWeirdness', forestWeirdnessNoise) + +// Forest layer +//const forestTypeLayer = TFC.misc.uniformLayeredArea(45245235242); +//for (let i = 0; i < 3; i++) { +// forestTypeLayer.zoom(true, 19763144126).smooth(79784123632); +//} +//for (let i = 0; i < 6; i++) { +// forestTypeLayer.zoom(true, 451364589723); +//} +//forestTypeLayer +// .smooth(71214856214) +// .zoom(true, 854126548632) +// .smooth(145256147896) + +let forestLayerNoise = TFC.misc.newOpenSimplex2D(3210378120) + .octaves(2) + .spread(0.005) + .scaled(0, 1) + +// Rock layer +const rockLayer = TFC.misc.uniformLayeredArea(413567326); +for (let i = 0; i < 3; i++) { + rockLayer.zoom(true, 19763144126).smooth(79784123632); +} +for (let i = 0; i < 6; i++) { + rockLayer.zoom(true, 451364589723); +} +rockLayer + .smooth(71214856214) + .zoom(true, 854126548632) + .smooth(145256147896) + + TFCEvents.createChunkDataProvider('mars', event => { + event.partial((data, chunk) => { + let x = chunk.pos.minBlockX; + let z = chunk.pos.minBlockZ; - const rain = TFC.misc.lerpFloatLayer(0, 0, 0, 0); - const tempLayer = TFC.misc.newOpenSimplex2D(event.worldSeed + 4621678939469) - .spread(0.002) - .octaves(3) - .scaled(70, 90) - const forestLayer = TFC.misc.newOpenSimplex2D(event.worldSeed + 98713856895664) - .spread(0.00002) - .terraces(9) - .affine(6, 12) - .scaled(6, 18, 0, 1) + const avgTemp1 = calcAverage(z, global.MARS_PLANET_SIZE, global.MARS_MIN_AVG_TEMP, global.MARS_MAX_AVG_TEMP) + const avgTemp2 = calcAverage(z + 15, global.MARS_PLANET_SIZE, global.MARS_MIN_AVG_TEMP, global.MARS_MAX_AVG_TEMP) + const avgRain1 = calcAverage(x, global.MARS_PLANET_SIZE, global.MARS_MIN_AVG_RAIN, global.MARS_MAX_AVG_RAIN) + const avgRain2 = calcAverage(x + 15, global.MARS_PLANET_SIZE, global.MARS_MIN_AVG_RAIN, global.MARS_MAX_AVG_RAIN) - const rockNoise = TFC.misc.newOpenSimplex2D(event.worldSeed + 8008135) - .octaves(3) - .scaled(0x80000000, 0x7fffffff) // Integer.MIN_VALUE to Integer.MAX_VALUE - .spread(0.00001) // spread it out so the vaiance is small + let rain = TFC.misc.lerpFloatLayer( + avgRain1 + rainLayer.noise(x, z), + avgRain1 + rainLayer.noise(x, z + 15), + avgRain2 + rainLayer.noise(x + 15, z), + avgRain2 + rainLayer.noise(x + 15, z + 15) + ); + let temp = TFC.misc.lerpFloatLayer( + avgTemp1 + tempLayer.noise(x, z), + avgTemp1 + tempLayer.noise(x, z + 15), + avgTemp2 + tempLayer.noise(x + 15, z), + avgTemp2 + tempLayer.noise(x + 15, z + 15) + ); - // Precompute the aquifer heights as constants as this is not used - var aquifer = []; - let i = 0; - while (i < 16) { - aquifer.push(32); - i++; - } + data.generatePartial( + rain, + temp, + //floatToForestType(((forestTypeLayer.getAt(x, z) / 0x80000000) / 2.0) + 0.5), + floatToForestType(forestLayerNoise.noise(x, z)), + forestWeirdnessNoise.noise(x, z), // forest weirdness + forestDensityNoise.noise(x, z) // forest density + ); + }); - event.partial((data, chunk) => { - let x = chunk.pos.minBlockX; - let z = chunk.pos.minBlockZ; + event.full((data, chunk) => { + let heights = []; + for (let z = 0; z < 16; z++) { + for (let x = 0; x < 16; x++) { + heights[x + 16 * z] = chunk.getHeight($HeightMap.Types.OCEAN_FLOOR_WG, x, z); + } + } + data.generateFull(heights, EMPTY_AQUIFER); + }); - let temp = TFC.misc.lerpFloatLayer( - tempLayer.noise(x, z), - tempLayer.noise(x, z + 15), - tempLayer.noise(x + 15, z), - tempLayer.noise(x + 15, z + 15) - ); - - let forestType = $ForestType.NONE; - const forestTypeNoise = forestLayer.noise(x, z); - if (forestTypeNoise < 0.2) - forestType = $ForestType.OLD_GROWTH; - else if (forestTypeNoise < 0.4) - forestType = $ForestType.NORMAL; - else if (forestTypeNoise < 0.6) - forestType = $ForestType.EDGE; - else if (forestTypeNoise < 0.8) - forestType = $ForestType.SPARSE; - - data.generatePartial( - rain, - temp, - forestType, - forestLayer.noise(x * 78423 + 869, z), - forestTypeNoise //forestLayer.noise(x, z * 651349 - 698763) - ); - }); - - event.full((data, chunk) => { - let heights = []; - for (let z = 0; z < 16; z++) { - for (let x = 0; x < 16; x++) { - heights[x + 16 * z] = chunk.getHeight($HeightMap.Types.OCEAN_FLOOR_WG, x, z); - } - } - data.generateFull(heights, aquifer); - }); - - event.rocks((x, y, z, surfaceY, cache, rockLayers) => { - return rockLayers.sampleAtLayer(rockNoise.noise(x, z), (surfaceY - y) / ROCK_LAYER_HEIGHT); - }); + event.rocks((x, y, z, surfaceY, cache, rockSettings) => { + return rockSettings.sampleAtLayer(rockLayer.getAt(x, z), (surfaceY - y) / ROCK_LAYER_HEIGHT); + }); }) + + +/** + * @param {number} playerZ The current Z level of the player + * @param {number} scale The size of the planet, from the south pole to the north (20k on earth with default TFC settings) + * @param {number} min The average value at the poles + * @param {number} max The average value at the equator + * @returns {number} + */ +function calcAverage(playerZ, scale, min, max) { + + let relative = (playerZ / scale * -1) + 0.5; + + // relative is now 1 for peak -z, 0 for peak +z + + let smoothed = Math.cos(relative * JavaMath.PI); + + // smoothed is now -1 for peak -z, 1 for peak +z + + let halfDiff = (min - max) / -2; + + let temp = (smoothed * halfDiff) - (halfDiff - max); + + return temp; +} + + +/** + * @param {number} float A number between 0 and 1 + * @returns {$ForestType} + */ +// Rhino moment +function floatToForestType(float) { + if (float < 0.2) + return $ForestType.OLD_GROWTH; + else if (float < 0.4) + return $ForestType.NORMAL; + else if (float < 0.6) + return $ForestType.EDGE; + else if (float < 0.8) + return $ForestType.SPARSE; + else + return $ForestType.NONE; +} \ No newline at end of file diff --git a/kubejs/server_scripts/tfg/events.forests.js b/kubejs/server_scripts/tfg/events.forests.js index 686924391..68f490d0d 100644 --- a/kubejs/server_scripts/tfg/events.forests.js +++ b/kubejs/server_scripts/tfg/events.forests.js @@ -8,11 +8,11 @@ TFCEvents.worldgenData(event => { // https://notenoughmail.github.io/kubejs_tfc/1.20.1/worldgen/#forest-types-map-entry // type, treeCount, groundcoverCount, perChunkChance, bushCount, hasSpoilerOldGrowth, allowsOldGrowth, leafPileCount - event.forestTypesMapEntry('none', [0, 1], 0, 0.02, 0, false, false, 0), - event.forestTypesMapEntry('sparse', [1, 3], 6, 0.2, 0, false, false, [0, 1]), - event.forestTypesMapEntry('edge', [2, 4], 15, 0.8, 1, true, false, [0, 1]), - event.forestTypesMapEntry('normal', [4, 6], 25, 1, 1, true, false, [1, 2]), - event.forestTypesMapEntry('old_growth', [5, 8], 40, 1, 2, true, true, [1, 2]) + event.forestTypesMapEntry('none', [0, 1], 1, 0.1, 0, false, false, 0), + event.forestTypesMapEntry('sparse', [0, 3], 10, 0.3, 1, false, false, [0, 1]), + event.forestTypesMapEntry('edge', [2, 5], 20, 0.8, 1, true, false, [1, 2]), + event.forestTypesMapEntry('normal', [5, 8], 35, 1, 2, true, false, [2, 3]), + event.forestTypesMapEntry('old_growth', [8, 12], 50, 1, 3, true, true, [3, 4]) ], false, placement => {} @@ -20,9 +20,10 @@ TFCEvents.worldgenData(event => { event.forestEntry('tfg:mars/crimson_forest_entry', climate => { - climate.maxTemp(-20) - climate.minTemp(-65) - climate.minRain(-10) + climate.maxTemp(-41) + climate.minTemp(-98) + climate.minRain(-12) + climate.fuzzy(true) }, 'beneath:wood/wood/crimson', // bush log 'beneath:wood/leaves/crimson', // bush leaves @@ -31,7 +32,6 @@ TFCEvents.worldgenData(event => { [ // ground cover 'minecraft:crimson_fungus', 'beneath:wood/fallen_leaves/crimson', - 'beneath:wood/leaves/crimson', 'beneath:wood/twig/crimson', 'tfg:groundcover/wraptor_feather', 'tfg:groundcover/glider_feather' @@ -44,16 +44,16 @@ TFCEvents.worldgenData(event => { null, // chance for old growth in non-old growth forests null, // chance for a fallen tree null, // chance for a dead tree - null, // true to spawn on ocean floor, false for world surface + null, // false (default) to spawn with the ocean floor heightmap, true for world surface placement => {} ) event.forestEntry('tfg:mars/warped_forest_entry', climate => { - climate.maxTemp(-20) - climate.minTemp(-65) - climate.minRain(-20) + climate.maxTemp(-39) + climate.minTemp(-101) climate.maxRain(0) + climate.fuzzy(true) }, 'beneath:wood/wood/warped', 'beneath:wood/leaves/warped', @@ -62,7 +62,6 @@ TFCEvents.worldgenData(event => { [ 'minecraft:warped_fungus', 'beneath:wood/fallen_leaves/warped', - 'beneath:wood/leaves/warped', 'beneath:wood/twig/warped', 'tfg:groundcover/wraptor_feather', 'tfg:groundcover/glider_feather' @@ -76,18 +75,16 @@ TFCEvents.worldgenData(event => { event.forestEntry('tfg:mars/aeronos_forest_entry', climate => { - climate.maxTemp(-30) - climate.minTemp(-85) - climate.minRain(-15) + climate.minTemp(-77) + climate.minRain(-14) + climate.fuzzy(true) }, 'ad_astra:aeronos_stem', 'ad_astra:aeronos_cap', - 'betterend:cave_bush', - 'betterend:cave_bush_fallen', + null, + null, [ "ad_astra:aeronos_mushroom", - 'betterend:cave_bush', - 'betterend:cave_bush_fallen', 'tfg:groundcover/wraptor_feather', 'tfg:groundcover/glider_feather', 'tfg:groundcover/aeronos_stick' @@ -101,18 +98,16 @@ TFCEvents.worldgenData(event => { event.forestEntry('tfg:mars/strophar_forest_entry', climate => { - climate.maxTemp(-20) - climate.minTemp(-80) - climate.maxRain(5) + climate.minTemp(-73) + climate.maxRain(2) + climate.fuzzy(true) }, 'ad_astra:strophar_stem', 'ad_astra:strophar_cap', - 'betterend:lucernia_leaves', - 'betterend:lucernia_leaves_fallen', + null, + null, [ "ad_astra:strophar_mushroom", - 'betterend:lucernia_leaves', - 'betterend:lucernia_leaves_fallen', 'tfg:groundcover/wraptor_feather', 'tfg:groundcover/glider_feather', 'tfg:groundcover/strophar_stick' @@ -126,18 +121,18 @@ TFCEvents.worldgenData(event => { event.forestEntry('tfg:mars/alphacene_forest_entry', climate => { - climate.minTemp(-40) + climate.minTemp(-65) + climate.fuzzy(true) }, - 'minecraft:mushroom_stem', - 'species:alphacene_mushroom_block', - 'minecraft:mushroom_stem', + null, + null, + null, null, [ "species:alphacene_mushroom", 'tfg:groundcover/wraptor_feather', 'tfg:groundcover/glider_feather', - 'tfg:groundcover/alphacene_stick', - 'tfc:groundcover/stick' + 'tfg:groundcover/alphacene_stick' ], 'species:alphacene_mushroom', 'tfg:mars/tree/alphacene_dead', diff --git a/kubejs/server_scripts/tfg/tags.js b/kubejs/server_scripts/tfg/tags.js index 42819c573..c618babb6 100644 --- a/kubejs/server_scripts/tfg/tags.js +++ b/kubejs/server_scripts/tfg/tags.js @@ -995,6 +995,14 @@ const registerTFGBlockTags = (event) => { event.add('forge:mineable/wrench', 'tfg:machine_casing_aluminium_plated_steel') event.add('tfg:decorative_plant_attachable', '#minecraft:logs') + event.add('tfg:decorative_plant_attachable', 'minecraft:mushroom_stem') + event.add('tfg:decorative_plant_attachable', 'species:alphacene_mushroom_block') + event.add('tfg:decorative_plant_attachable', 'ad_astra:aeronos_cap') + event.add('tfg:decorative_plant_attachable', 'ad_astra:strophar_cap') + event.add('tfg:decorative_plant_attachable', 'minecraft:nether_wart_block') + event.add('tfg:decorative_plant_attachable', 'minecraft:warped_wart_block') + event.add('tfg:decorative_plant_attachable', 'betterend:cave_bush') + event.add('tfg:decorative_plant_attachable', 'betterend:lucernia_leaves') } //#endregion diff --git a/kubejs/startup_scripts/betterend/blocks.js b/kubejs/startup_scripts/betterend/blocks.js index 9f6b35914..106e023a9 100644 --- a/kubejs/startup_scripts/betterend/blocks.js +++ b/kubejs/startup_scripts/betterend/blocks.js @@ -139,7 +139,7 @@ function registerBetterEndBlocks(event) { leaves.soundType('azalea_leaves') leaves.tagBlock('minecraft:mineable/hoe') leaves.tagBlock('minecraft:replaceable') - // TODO: kjs-tfc 1.3.3 will have an option to disable tinting on leaves + leaves.noDynamicTinting() leaves.models((modelType, generator) => { if (modelType.layers != 8) { generator.parent("tfc:block/groundcover/fallen_leaves_height" + modelType.height); @@ -164,7 +164,7 @@ function registerBetterEndBlocks(event) { leaves.soundType('azalea_leaves') leaves.tagBlock('minecraft:mineable/hoe') leaves.tagBlock('minecraft:replaceable') - // TODO: kjs-tfc 1.3.3 will have an option to disable tinting on leaves + leaves.noDynamicTinting() leaves.models((modelType, generator) => { if (modelType.layers != 8) { generator.parent("tfc:block/groundcover/fallen_leaves_height" + modelType.height); diff --git a/kubejs/startup_scripts/tfc/register_climates.js b/kubejs/startup_scripts/tfc/register_climates.js index ec0317c87..bd2ff6d5a 100644 --- a/kubejs/startup_scripts/tfc/register_climates.js +++ b/kubejs/startup_scripts/tfc/register_climates.js @@ -12,6 +12,12 @@ const TWO_PI = JavaMath.PI * 2; const OXYGENATED_TEMP = 15; +global.MARS_PLANET_SIZE = 10000; +global.MARS_MIN_AVG_TEMP = -110; +global.MARS_MAX_AVG_TEMP = -15; +global.MARS_MIN_AVG_RAIN = -25; +global.MARS_MAX_AVG_RAIN = 13; + function clamp(val, min, max) { return Math.min(Math.max(val, min), max); } @@ -147,22 +153,22 @@ TFCEvents.registerClimateModel(event => { } // average of -110 at night, -15 at day - let avgTemp = calcAverage(pos.z, 10000, -110, -15); + let avgTemp = calcAverage(pos.z, global.MARS_PLANET_SIZE, -110, -15); // +- 45 based on latitude, down to -10 at bedrock - return calcCurrentTemp(avgTemp, 65, pos.y, calendarTicks, 45, -10, 0.5); + return calcCurrentTemp(avgTemp, 88, pos.y, calendarTicks, 45, -10, 0.5); }) builder.setAverageTemperatureCalculation((level, pos) => { // Earth is 10k to each pole, and mars is about half as big as earth, so 5k to each pole sounds good - return calcAverage(pos.z, 10000, -110, -15); + return calcAverage(pos.z, global.MARS_PLANET_SIZE, -110, -15); }) builder.setAverageRainfallCalculation((level, pos) => { // irl mars' poles have a snowfall of 0.13mm but that's barely noticeable here. // Use a negative rainfall to stop it snowing closer to the equator. TFC clamps negatives to zero so it's fine - return calcAverage(pos.x, 10000, 13, -25) + return calcAverage(pos.x, global.MARS_PLANET_SIZE, -25, 13) }) builder.setAirFog((level, pos, calendarTicks) => 0)