From 58286d4381b10afd3b56ff1af770768a63546a45 Mon Sep 17 00:00:00 2001 From: dags- Date: Tue, 19 May 2020 22:46:52 +0100 Subject: [PATCH] adjust lake gen --- Engine | 2 +- FeatureManager | 2 +- .../terraforged/util/setup/SetupDebug.java | 26 ++++++++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Engine b/Engine index 638e803..637b43e 160000 --- a/Engine +++ b/Engine @@ -1 +1 @@ -Subproject commit 638e8033704f282b7e737ce2fd6d4e5653a1e1b8 +Subproject commit 637b43efb49d4aabe5332118caf8d72be1339a49 diff --git a/FeatureManager b/FeatureManager index e0a7f10..8810eb5 160000 --- a/FeatureManager +++ b/FeatureManager @@ -1 +1 @@ -Subproject commit e0a7f101243b6d54a6e5943b424e5a3b4cf3b93c +Subproject commit 8810eb585979a995ae37351cb9339ff805053a99 diff --git a/src/main/java/com/terraforged/util/setup/SetupDebug.java b/src/main/java/com/terraforged/util/setup/SetupDebug.java index 729029a..838716a 100644 --- a/src/main/java/com/terraforged/util/setup/SetupDebug.java +++ b/src/main/java/com/terraforged/util/setup/SetupDebug.java @@ -27,6 +27,13 @@ package com.terraforged.util.setup; import com.terraforged.Log; import com.terraforged.api.event.SetupEvent; +import com.terraforged.core.Seed; +import com.terraforged.world.geology.Strata; +import me.dags.noise.Source; +import me.dags.noise.source.Builder; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.world.biome.Biomes; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @@ -50,7 +57,24 @@ public class SetupDebug { @SubscribeEvent public static void geology(SetupEvent.Geology event) { - log(event); + Seed seed = event.getContext().seed; + + // Noise parameters used to vary the depth of the strata bands + Builder noise = Source.build(seed.next(), 150, 1); + + // Set each layer material & its relative depth (top to bottom) + Strata strata = Strata.builder(seed.next(), noise) + .add(Blocks.STONE.getDefaultState(), 0.5) + .add(Blocks.GRANITE.getDefaultState(), 0.3) + .add(Blocks.DIORITE.getDefaultState(), 0.2) + // Note - you can specify the noise type to be used for a layer using the Source enum (default is Perlin) + .add(Source.RIDGE, Blocks.STONE.getDefaultState(), 0.1) + .build(); + + // Register to a specific biome. This creates a new geology system specific to that biome. The boolean + // flag 'inheritGlobal' determines whether global strata layers should be copied to this new geology system. + // If set false then only the strata specifically registered to it will be used. + event.getManager().register(Biomes.OCEAN, strata, true); } @SubscribeEvent