tree stuff

This commit is contained in:
Pyritie 2025-08-16 02:55:49 +01:00
parent c6fbc05290
commit f2380e9ebd
2 changed files with 35 additions and 13 deletions

View file

@ -2,6 +2,7 @@
"use strict";
const $HeightMap = Java.loadClass("net.minecraft.world.level.levelgen.Heightmap")
const $ForestType = Java.loadClass("net.dries007.tfc.world.chunkdata.ForestType")
const ROCK_LAYER_HEIGHT = 40;
@ -70,12 +71,23 @@ TFCEvents.createChunkDataProvider('mars', event => {
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,
forestLayer.noise(x, z) * 4, // Kube accepts ordinal numbers for enum constants
forestType,
forestLayer.noise(x * 78423 + 869, z),
forestLayer.noise(x, z * 651349 - 698763)
forestTypeNoise //forestLayer.noise(x, z * 651349 - 698763)
);
});

View file

@ -5,13 +5,13 @@ TFCEvents.worldgenData(event => {
event.forest('tfg:mars_forest', '#tfg:mars_forest_entries',
[
event.forestTypesMapEntry('none', 0, 0, 0, 0, false, false, 0),
event.forestTypesMapEntry('sparse', [1, 3], 6, 0.08, 0, true, false, null),
event.forestTypesMapEntry('edge', 2, 10, null, 1, false, false, [0, 1]),
event.forestTypesMapEntry('normal', 5, 25, null, 1, true, false, null),
event.forestTypesMapEntry('old_growth', 7, 40, null, 1, false, true, [0, 1])
event.forestTypesMapEntry('none', [1, 3], 0, 0, 0, false, false, 0),
event.forestTypesMapEntry('sparse', [2, 5], 6, 0.08, 0, true, false, null),
event.forestTypesMapEntry('edge', 5, 15, 0.1, 1, true, true, [0, 1]),
event.forestTypesMapEntry('normal', 10, 25, 0.1, 1, true, true, [1, 2]),
event.forestTypesMapEntry('old_growth', 15, 40, 0.2, 1, true, true, [1, 2])
],
true,
false,
placement => {}
)
@ -24,7 +24,9 @@ TFCEvents.worldgenData(event => {
[ // ground cover
'minecraft:crimson_fungus',
'beneath:wood/fallen_leaves/crimson',
'beneath:wood/twig/crimson'
'beneath:wood/twig/crimson',
'tfc:groundcover/feather',
'tfc:groundcover/stick'
],
'tfg:mars/tree/crimson', // tree feature
'tfg:mars/tree/crimson_dead', // dead tree feature
@ -47,7 +49,9 @@ TFCEvents.worldgenData(event => {
[
'minecraft:warped_fungus',
'beneath:wood/fallen_leaves/warped',
'beneath:wood/twig/warped'
'beneath:wood/twig/warped',
'tfc:groundcover/feather',
'tfc:groundcover/stick'
],
'tfg:mars/tree/warped',
'tfg:mars/tree/warped_dead',
@ -65,7 +69,9 @@ TFCEvents.worldgenData(event => {
[
"ad_astra:aeronos_mushroom",
'beneath:wood/fallen_leaves/crimson',
'beneath:wood/twig/crimson'
'beneath:wood/twig/crimson',
'tfc:groundcover/feather',
'tfc:groundcover/stick'
],
'tfg:mars/tree/aeronos',
'tfg:mars/tree/aeronos_dead',
@ -83,7 +89,9 @@ TFCEvents.worldgenData(event => {
[
"ad_astra:strophar_mushroom",
'beneath:wood/fallen_leaves/warped',
'beneath:wood/twig/warped'
'beneath:wood/twig/warped',
'tfc:groundcover/feather',
'tfc:groundcover/stick'
],
'tfg:mars/tree/strophar',
'tfg:mars/tree/strophar_dead',
@ -101,7 +109,9 @@ TFCEvents.worldgenData(event => {
[
"species:alphacene_mushroom",
'beneath:wood/fallen_leaves/crimson',
'beneath:wood/twig/crimson'
'beneath:wood/twig/crimson',
'tfc:groundcover/feather',
'tfc:groundcover/stick'
],
'species:alphacene_mushroom',
'tfg:mars/tree/alphacene_dead',