From f2380e9ebde67b69a5efc99fb4b266793291596b Mon Sep 17 00:00:00 2001 From: Pyritie Date: Sat, 16 Aug 2025 02:55:49 +0100 Subject: [PATCH] tree stuff --- kubejs/server_scripts/tfg/events.chunks.js | 16 +++++++++-- kubejs/server_scripts/tfg/events.forests.js | 32 ++++++++++++++------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/kubejs/server_scripts/tfg/events.chunks.js b/kubejs/server_scripts/tfg/events.chunks.js index e6979a49f..ad12db91c 100644 --- a/kubejs/server_scripts/tfg/events.chunks.js +++ b/kubejs/server_scripts/tfg/events.chunks.js @@ -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) ); }); diff --git a/kubejs/server_scripts/tfg/events.forests.js b/kubejs/server_scripts/tfg/events.forests.js index e4045d179..7e1551a4e 100644 --- a/kubejs/server_scripts/tfg/events.forests.js +++ b/kubejs/server_scripts/tfg/events.forests.js @@ -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',