From b935b9ab81334301c6ff04486c763408fdd3e528 Mon Sep 17 00:00:00 2001 From: dags- Date: Fri, 15 May 2020 22:21:13 +0100 Subject: [PATCH] - steppier steppes & plainier plains - more tree types converted to poisson/context decorators - more work on threadpool/batching --- Engine | 2 +- .../java/com/terraforged/TerraForgedMod.java | 2 +- .../modifier/AbstractMaxHeightModifier.java | 2 +- .../com/terraforged/api/event/SetupEvent.java | 2 +- .../biome/map/AbstractBiomeMap.java | 2 +- .../biome/map/BiomeMapBuilder.java | 2 +- .../modifier/AbstractMaxHeightModifier.java | 2 +- .../biome/modifier/BiomeModifierManager.java | 4 +- .../biome/modifier/DunesModifier.java | 24 +++++ .../biome/modifier/SandBiomeModifier.java | 4 +- .../biome/provider/BiomeHelper.java | 4 +- .../biome/provider/BiomeProvider.java | 10 +- .../biome/provider/DesertBiomes.java | 6 +- .../terraforged/biome/spawn/SpawnHandler.java | 2 +- .../terraforged/biome/spawn/SpawnSearch.java | 2 +- .../biome/tag/BiomeTagManager.java | 2 +- .../chunk/TerraChunkGenerator.java | 20 ++-- .../com/terraforged/chunk/TerraContext.java | 6 +- .../terraforged/chunk/TerraSetupFactory.java | 21 ++--- .../column}/BedrockDecorator.java | 2 +- .../column}/ChunkPopulator.java | 2 +- .../column}/CoastDecorator.java | 2 +- .../column}/ErosionDecorator.java | 2 +- .../column}/GeologyDecorator.java | 2 +- .../column/post}/LayerDecorator.java | 2 +- .../column/post}/SnowEroder.java | 4 +- .../chunk/generator/TerrainGenerator.java | 2 +- .../java/com/terraforged/chunk/test/Test.java | 4 +- .../chunk/test/TestChunkGenerator.java | 6 +- .../com/terraforged/command/TerraCommand.java | 8 +- .../feature/context/ChanceContext.java | 16 ++-- .../context/ContextSelectorFeature.java | 6 +- .../feature/context/modifier/Biome.java | 9 +- .../feature/context/modifier/Elevation.java | 8 +- .../modifier/RangeContextModifier.java | 23 ++++- .../decorator/poisson/BiomeVariance.java | 4 +- .../decorator/poisson/PoissonConfig.java | 61 ++++++++++--- .../decorator/poisson/PoissonDecorator.java | 21 +---- .../feature/predicate/TreeLine.java | 2 +- .../feature/sapling/SaplingConfig.java | 2 +- .../feature/sapling/SaplingListener.java | 4 +- .../java/com/terraforged/gui/ScrollPane.java | 2 +- .../com/terraforged/gui/SettingsScreen.java | 8 +- .../com/terraforged/gui/page/ClimatePage.java | 2 +- .../java/com/terraforged/gui/page/Page.java | 8 +- .../com/terraforged/gui/page/TerrainPage.java | 2 +- .../com/terraforged/gui/preview/Preview.java | 6 +- .../com/terraforged/material/Materials.java | 8 +- .../material/geology/GeoManager.java | 4 +- .../settings/DimesionSettings.java | 2 +- .../terraforged/settings/TerraSettings.java | 2 +- .../terraforged/util/DummyBlockReader.java | 3 +- .../com/terraforged/util/RangeModifier.java | 34 +++---- .../terraforged/util/setup/SetupDebug.java | 2 +- .../terraforged/util/setup/SetupHooks.java | 2 +- .../terraforged/features/trees/birch.json | 8 +- .../terraforged/features/trees/birch_oak.json | 8 +- .../terraforged/features/trees/dark_oak.json | 8 +- .../features/trees/fir_foreset.json | 26 +++--- .../features/trees/flower_forest.json | 8 +- .../terraforged/features/trees/jungle.json | 8 +- .../features/trees/jungle_edge.json | 8 +- .../features/trees/jungle_hills.json | 8 +- .../features/trees/oak_forest.json | 7 +- .../data/terraforged/features/trees/pine.json | 8 +- .../terraforged/features/trees/redwood.json | 91 ++++++++++++++----- .../terraforged/features/trees/spruce.json | 8 +- src/main/resources/redwood.json | 59 ++++++++++++ 68 files changed, 403 insertions(+), 248 deletions(-) create mode 100644 src/main/java/com/terraforged/biome/modifier/DunesModifier.java rename src/main/java/com/terraforged/{decorator/terrain => chunk/column}/BedrockDecorator.java (98%) rename src/main/java/com/terraforged/{decorator => chunk/column}/ChunkPopulator.java (98%) rename src/main/java/com/terraforged/{decorator/terrain => chunk/column}/CoastDecorator.java (98%) rename src/main/java/com/terraforged/{decorator/terrain => chunk/column}/ErosionDecorator.java (99%) rename src/main/java/com/terraforged/{decorator/terrain => chunk/column}/GeologyDecorator.java (98%) rename src/main/java/com/terraforged/{decorator/feature => chunk/column/post}/LayerDecorator.java (98%) rename src/main/java/com/terraforged/{decorator/feature => chunk/column/post}/SnowEroder.java (97%) create mode 100644 src/main/resources/redwood.json diff --git a/Engine b/Engine index 67af304..72118ad 160000 --- a/Engine +++ b/Engine @@ -1 +1 @@ -Subproject commit 67af3049fe2b82e8edb5cf0afb87cdf8314b2c97 +Subproject commit 72118adaa8891b76dda2405c76f0d985f81cd614 diff --git a/src/main/java/com/terraforged/TerraForgedMod.java b/src/main/java/com/terraforged/TerraForgedMod.java index 19ad444..bedf090 100644 --- a/src/main/java/com/terraforged/TerraForgedMod.java +++ b/src/main/java/com/terraforged/TerraForgedMod.java @@ -28,10 +28,10 @@ package com.terraforged; import com.terraforged.api.material.WGTags; import com.terraforged.command.TerraCommand; import com.terraforged.data.DataGen; +import com.terraforged.feature.context.ContextSelectorFeature; import com.terraforged.feature.decorator.poisson.PoissonAtSurface; import com.terraforged.feature.feature.DiskFeature; import com.terraforged.fm.template.TemplateManager; -import com.terraforged.feature.context.ContextSelectorFeature; import com.terraforged.settings.SettingsHelper; import com.terraforged.util.DataPackFinder; import com.terraforged.util.Environment; diff --git a/src/main/java/com/terraforged/api/biome/modifier/AbstractMaxHeightModifier.java b/src/main/java/com/terraforged/api/biome/modifier/AbstractMaxHeightModifier.java index 7149583..4aa62f8 100644 --- a/src/main/java/com/terraforged/api/biome/modifier/AbstractMaxHeightModifier.java +++ b/src/main/java/com/terraforged/api/biome/modifier/AbstractMaxHeightModifier.java @@ -25,8 +25,8 @@ package com.terraforged.api.biome.modifier; -import com.terraforged.core.cell.Cell; import com.terraforged.core.Seed; +import com.terraforged.core.cell.Cell; import com.terraforged.world.climate.Climate; import me.dags.noise.Module; import me.dags.noise.Source; diff --git a/src/main/java/com/terraforged/api/event/SetupEvent.java b/src/main/java/com/terraforged/api/event/SetupEvent.java index c69ae7a..4491fd6 100644 --- a/src/main/java/com/terraforged/api/event/SetupEvent.java +++ b/src/main/java/com/terraforged/api/event/SetupEvent.java @@ -30,10 +30,10 @@ import com.terraforged.api.chunk.column.DecoratorManager; import com.terraforged.api.chunk.surface.SurfaceManager; import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.layer.LayerManager; +import com.terraforged.fm.modifier.FeatureModifiers; import com.terraforged.fm.structure.StructureManager; import com.terraforged.world.GeneratorContext; import com.terraforged.world.terrain.provider.TerrainProvider; -import com.terraforged.fm.modifier.FeatureModifiers; import net.minecraftforge.eventbus.api.Event; public abstract class SetupEvent extends Event { diff --git a/src/main/java/com/terraforged/biome/map/AbstractBiomeMap.java b/src/main/java/com/terraforged/biome/map/AbstractBiomeMap.java index 7b9b6a9..4895204 100644 --- a/src/main/java/com/terraforged/biome/map/AbstractBiomeMap.java +++ b/src/main/java/com/terraforged/biome/map/AbstractBiomeMap.java @@ -28,9 +28,9 @@ package com.terraforged.biome.map; import com.google.common.collect.Sets; import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import com.terraforged.biome.ModBiomes; import com.terraforged.biome.provider.BiomeHelper; import com.terraforged.world.biome.BiomeType; -import com.terraforged.biome.ModBiomes; import me.dags.noise.util.NoiseUtil; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; diff --git a/src/main/java/com/terraforged/biome/map/BiomeMapBuilder.java b/src/main/java/com/terraforged/biome/map/BiomeMapBuilder.java index 2f9b036..d60943a 100644 --- a/src/main/java/com/terraforged/biome/map/BiomeMapBuilder.java +++ b/src/main/java/com/terraforged/biome/map/BiomeMapBuilder.java @@ -27,9 +27,9 @@ package com.terraforged.biome.map; import com.terraforged.biome.provider.BiomeHelper; import com.terraforged.core.util.grid.FixedGrid; +import com.terraforged.util.ListUtils; import com.terraforged.world.biome.BiomeData; import com.terraforged.world.biome.BiomeType; -import com.terraforged.util.ListUtils; import net.minecraft.world.biome.Biome; import java.util.ArrayList; diff --git a/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java b/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java index 5fc0d7e..d77534b 100644 --- a/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java +++ b/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java @@ -25,8 +25,8 @@ package com.terraforged.biome.modifier; -import com.terraforged.core.cell.Cell; import com.terraforged.core.Seed; +import com.terraforged.core.cell.Cell; import com.terraforged.world.climate.Climate; import me.dags.noise.Module; import me.dags.noise.Source; diff --git a/src/main/java/com/terraforged/biome/modifier/BiomeModifierManager.java b/src/main/java/com/terraforged/biome/modifier/BiomeModifierManager.java index d94ae9a..267f937 100644 --- a/src/main/java/com/terraforged/biome/modifier/BiomeModifierManager.java +++ b/src/main/java/com/terraforged/biome/modifier/BiomeModifierManager.java @@ -27,11 +27,11 @@ package com.terraforged.biome.modifier; import com.terraforged.api.biome.modifier.BiomeModifier; import com.terraforged.api.biome.modifier.ModifierManager; +import com.terraforged.biome.map.BiomeMap; import com.terraforged.biome.provider.DesertBiomes; +import com.terraforged.chunk.TerraContext; import com.terraforged.core.cell.Cell; import com.terraforged.world.biome.BiomeType; -import com.terraforged.biome.map.BiomeMap; -import com.terraforged.chunk.TerraContext; import net.minecraft.world.biome.Biome; import java.util.ArrayList; diff --git a/src/main/java/com/terraforged/biome/modifier/DunesModifier.java b/src/main/java/com/terraforged/biome/modifier/DunesModifier.java new file mode 100644 index 0000000..bb2b934 --- /dev/null +++ b/src/main/java/com/terraforged/biome/modifier/DunesModifier.java @@ -0,0 +1,24 @@ +package com.terraforged.biome.modifier; + +import com.terraforged.api.biome.modifier.BiomeModifier; +import com.terraforged.core.cell.Cell; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.Biomes; + +public class DunesModifier implements BiomeModifier { + + @Override + public int priority() { + return 0; + } + + @Override + public boolean test(Biome biome) { + return biome.getCategory() == Biome.Category.DESERT; + } + + @Override + public Biome modify(Biome in, Cell cell, int x, int z) { + return Biomes.DESERT; + } +} diff --git a/src/main/java/com/terraforged/biome/modifier/SandBiomeModifier.java b/src/main/java/com/terraforged/biome/modifier/SandBiomeModifier.java index 7f4ba06..8e43b28 100644 --- a/src/main/java/com/terraforged/biome/modifier/SandBiomeModifier.java +++ b/src/main/java/com/terraforged/biome/modifier/SandBiomeModifier.java @@ -25,8 +25,8 @@ package com.terraforged.biome.modifier; -import com.terraforged.core.cell.Cell; import com.terraforged.chunk.TerraContext; +import com.terraforged.core.cell.Cell; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import net.minecraftforge.registries.ForgeRegistries; @@ -53,7 +53,7 @@ public class SandBiomeModifier extends AbstractMaxHeightModifier { @Override public boolean test(Biome biome) { - return biome.getCategory() == Biome.Category.DESERT || biomes.contains(biome); + return biome.getCategory() == Biome.Category.DESERT && biomes.contains(biome); } @Override diff --git a/src/main/java/com/terraforged/biome/provider/BiomeHelper.java b/src/main/java/com/terraforged/biome/provider/BiomeHelper.java index 8491922..e79a972 100644 --- a/src/main/java/com/terraforged/biome/provider/BiomeHelper.java +++ b/src/main/java/com/terraforged/biome/provider/BiomeHelper.java @@ -25,12 +25,12 @@ package com.terraforged.biome.provider; -import com.terraforged.world.biome.BiomeData; -import com.terraforged.world.biome.BiomeType; import com.terraforged.biome.ModBiomes; import com.terraforged.biome.map.BiomeMap; import com.terraforged.biome.map.BiomeMapBuilder; import com.terraforged.biome.map.BiomePredicate; +import com.terraforged.world.biome.BiomeData; +import com.terraforged.world.biome.BiomeType; import me.dags.noise.util.Vec2f; import net.minecraft.util.ResourceLocation; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/biome/provider/BiomeProvider.java b/src/main/java/com/terraforged/biome/provider/BiomeProvider.java index 945f5c0..ef8b401 100644 --- a/src/main/java/com/terraforged/biome/provider/BiomeProvider.java +++ b/src/main/java/com/terraforged/biome/provider/BiomeProvider.java @@ -26,15 +26,15 @@ package com.terraforged.biome.provider; import com.google.common.collect.Sets; -import com.terraforged.core.cell.Cell; -import com.terraforged.core.region.chunk.ChunkReader; -import com.terraforged.world.terrain.decorator.Decorator; -import com.terraforged.world.heightmap.WorldLookup; import com.terraforged.biome.map.BiomeMap; import com.terraforged.biome.modifier.BiomeModifierManager; -import com.terraforged.chunk.util.TerraContainer; import com.terraforged.chunk.TerraContext; +import com.terraforged.chunk.util.TerraContainer; +import com.terraforged.core.cell.Cell; +import com.terraforged.core.region.chunk.ChunkReader; import com.terraforged.util.setup.SetupHooks; +import com.terraforged.world.heightmap.WorldLookup; +import com.terraforged.world.terrain.decorator.Decorator; import net.minecraft.util.math.BlockPos; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/biome/provider/DesertBiomes.java b/src/main/java/com/terraforged/biome/provider/DesertBiomes.java index 0f74549..835fde0 100644 --- a/src/main/java/com/terraforged/biome/provider/DesertBiomes.java +++ b/src/main/java/com/terraforged/biome/provider/DesertBiomes.java @@ -27,7 +27,7 @@ package com.terraforged.biome.provider; import com.terraforged.api.material.layer.LayerManager; import com.terraforged.api.material.layer.LayerMaterial; -import com.terraforged.core.concurrent.ObjectPool; +import com.terraforged.core.concurrent.Resource; import com.terraforged.material.Materials; import com.terraforged.util.DummyBlockReader; import com.terraforged.util.ListUtils; @@ -60,10 +60,10 @@ public class DesertBiomes { public DesertBiomes(Materials materials, List deserts) { List white = new LinkedList<>(); List red = new LinkedList<>(); - try (ObjectPool.Item reader = DummyBlockReader.pooled()) { + try (Resource reader = DummyBlockReader.pooled()) { for (Biome biome : deserts) { BlockState top = biome.getSurfaceBuilderConfig().getTop(); - MaterialColor color = top.getMaterialColor(reader.getValue().set(top), BlockPos.ZERO); + MaterialColor color = top.getMaterialColor(reader.get().set(top), BlockPos.ZERO); int whiteDist2 = distance2(color, MaterialColor.SAND); int redDist2 = distance2(color, MaterialColor.ADOBE); if (whiteDist2 < redDist2) { diff --git a/src/main/java/com/terraforged/biome/spawn/SpawnHandler.java b/src/main/java/com/terraforged/biome/spawn/SpawnHandler.java index c0da46c..aee3084 100644 --- a/src/main/java/com/terraforged/biome/spawn/SpawnHandler.java +++ b/src/main/java/com/terraforged/biome/spawn/SpawnHandler.java @@ -1,8 +1,8 @@ package com.terraforged.biome.spawn; +import com.terraforged.Log; import com.terraforged.biome.provider.BiomeProvider; import com.terraforged.world.continent.MutableVeci; -import com.terraforged.Log; import net.minecraft.util.math.BlockPos; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.Feature; diff --git a/src/main/java/com/terraforged/biome/spawn/SpawnSearch.java b/src/main/java/com/terraforged/biome/spawn/SpawnSearch.java index bbafdf2..bb388ca 100644 --- a/src/main/java/com/terraforged/biome/spawn/SpawnSearch.java +++ b/src/main/java/com/terraforged/biome/spawn/SpawnSearch.java @@ -1,9 +1,9 @@ package com.terraforged.biome.spawn; +import com.terraforged.Log; import com.terraforged.biome.provider.BiomeProvider; import com.terraforged.command.search.Search; import com.terraforged.core.cell.Cell; -import com.terraforged.Log; import net.minecraft.util.math.BlockPos; public class SpawnSearch extends Search { diff --git a/src/main/java/com/terraforged/biome/tag/BiomeTagManager.java b/src/main/java/com/terraforged/biome/tag/BiomeTagManager.java index 303b4c8..371a414 100644 --- a/src/main/java/com/terraforged/biome/tag/BiomeTagManager.java +++ b/src/main/java/com/terraforged/biome/tag/BiomeTagManager.java @@ -25,8 +25,8 @@ package com.terraforged.biome.tag; -import com.terraforged.api.biome.BiomeTags; import com.terraforged.Log; +import com.terraforged.api.biome.BiomeTags; import net.minecraft.profiler.IProfiler; import net.minecraft.resources.IFutureReloadListener; import net.minecraft.resources.IResourceManager; diff --git a/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java b/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java index 1c42fe1..d69721b 100644 --- a/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java +++ b/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java @@ -25,26 +25,26 @@ package com.terraforged.chunk; +import com.terraforged.Log; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.surface.SurfaceManager; import com.terraforged.api.material.layer.LayerManager; import com.terraforged.biome.provider.BiomeProvider; -import com.terraforged.core.cell.Cell; -import com.terraforged.core.region.Size; -import com.terraforged.core.region.chunk.ChunkReader; -import com.terraforged.core.region.gen.RegionCache; -import com.terraforged.fm.structure.StructureManager; -import com.terraforged.fm.FeatureManager; -import com.terraforged.material.Materials; -import com.terraforged.material.geology.GeoManager; -import com.terraforged.fm.data.DataManager; -import com.terraforged.Log; import com.terraforged.chunk.generator.BiomeGenerator; import com.terraforged.chunk.generator.MobGenerator; import com.terraforged.chunk.generator.StructureGenerator; import com.terraforged.chunk.generator.TerrainCarver; import com.terraforged.chunk.generator.TerrainGenerator; +import com.terraforged.core.cell.Cell; +import com.terraforged.core.region.Size; +import com.terraforged.core.region.chunk.ChunkReader; +import com.terraforged.core.region.gen.RegionCache; import com.terraforged.feature.BlockDataManager; +import com.terraforged.fm.FeatureManager; +import com.terraforged.fm.data.DataManager; +import com.terraforged.fm.structure.StructureManager; +import com.terraforged.material.Materials; +import com.terraforged.material.geology.GeoManager; import com.terraforged.util.Environment; import com.terraforged.util.setup.SetupHooks; import net.minecraft.entity.EntityClassification; diff --git a/src/main/java/com/terraforged/chunk/TerraContext.java b/src/main/java/com/terraforged/chunk/TerraContext.java index bfa8f83..a380d24 100644 --- a/src/main/java/com/terraforged/chunk/TerraContext.java +++ b/src/main/java/com/terraforged/chunk/TerraContext.java @@ -28,15 +28,15 @@ package com.terraforged.chunk; import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.api.chunk.surface.ChunkSurfaceBuffer; import com.terraforged.api.chunk.surface.SurfaceContext; +import com.terraforged.core.concurrent.pool.ThreadPools; import com.terraforged.core.region.gen.RegionCache; import com.terraforged.core.region.gen.RegionGenerator; -import com.terraforged.core.concurrent.ThreadPool; import com.terraforged.material.Materials; +import com.terraforged.settings.TerraSettings; import com.terraforged.world.GeneratorContext; import com.terraforged.world.WorldGeneratorFactory; import com.terraforged.world.heightmap.Heightmap; import com.terraforged.world.terrain.Terrains; -import com.terraforged.settings.TerraSettings; import net.minecraft.world.IWorld; import net.minecraft.world.chunk.IChunk; import net.minecraft.world.gen.GenerationSettings; @@ -76,7 +76,7 @@ public class TerraContext extends GeneratorContext { return RegionGenerator.builder() .factory(factory) .size(3, 2) - .pool(ThreadPool.getPool()) + .pool(ThreadPools.getPool()) .batch(6) .build() .toCache(); diff --git a/src/main/java/com/terraforged/chunk/TerraSetupFactory.java b/src/main/java/com/terraforged/chunk/TerraSetupFactory.java index a5617f8..ff51456 100644 --- a/src/main/java/com/terraforged/chunk/TerraSetupFactory.java +++ b/src/main/java/com/terraforged/chunk/TerraSetupFactory.java @@ -1,30 +1,29 @@ package com.terraforged.chunk; +import com.terraforged.Log; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.surface.SurfaceManager; import com.terraforged.biome.ModBiomes; import com.terraforged.biome.surface.IcebergsSurface; import com.terraforged.biome.surface.SwampSurface; -import com.terraforged.decorator.feature.LayerDecorator; -import com.terraforged.decorator.feature.SnowEroder; +import com.terraforged.chunk.column.BedrockDecorator; +import com.terraforged.chunk.column.CoastDecorator; +import com.terraforged.chunk.column.ErosionDecorator; +import com.terraforged.chunk.column.GeologyDecorator; +import com.terraforged.chunk.column.post.LayerDecorator; +import com.terraforged.chunk.column.post.SnowEroder; +import com.terraforged.feature.BlockDataManager; import com.terraforged.feature.Matchers; -import com.terraforged.fm.structure.StructureManager; import com.terraforged.fm.FeatureManager; +import com.terraforged.fm.data.DataManager; import com.terraforged.fm.matcher.biome.BiomeMatcher; import com.terraforged.fm.matcher.feature.FeatureMatcher; import com.terraforged.fm.modifier.FeatureModifiers; import com.terraforged.fm.predicate.DeepWater; import com.terraforged.fm.predicate.FeaturePredicate; -import com.terraforged.fm.predicate.MinDepth; import com.terraforged.fm.predicate.MinHeight; +import com.terraforged.fm.structure.StructureManager; import com.terraforged.material.geology.GeoManager; -import com.terraforged.Log; -import com.terraforged.decorator.terrain.BedrockDecorator; -import com.terraforged.decorator.terrain.CoastDecorator; -import com.terraforged.decorator.terrain.ErosionDecorator; -import com.terraforged.decorator.terrain.GeologyDecorator; -import com.terraforged.feature.BlockDataManager; -import com.terraforged.fm.data.DataManager; import com.terraforged.util.setup.SetupHooks; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; diff --git a/src/main/java/com/terraforged/decorator/terrain/BedrockDecorator.java b/src/main/java/com/terraforged/chunk/column/BedrockDecorator.java similarity index 98% rename from src/main/java/com/terraforged/decorator/terrain/BedrockDecorator.java rename to src/main/java/com/terraforged/chunk/column/BedrockDecorator.java index 7c6e8aa..19ac871 100644 --- a/src/main/java/com/terraforged/decorator/terrain/BedrockDecorator.java +++ b/src/main/java/com/terraforged/chunk/column/BedrockDecorator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.decorator.terrain; +package com.terraforged.chunk.column; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; diff --git a/src/main/java/com/terraforged/decorator/ChunkPopulator.java b/src/main/java/com/terraforged/chunk/column/ChunkPopulator.java similarity index 98% rename from src/main/java/com/terraforged/decorator/ChunkPopulator.java rename to src/main/java/com/terraforged/chunk/column/ChunkPopulator.java index 1a286d4..2d602ed 100644 --- a/src/main/java/com/terraforged/decorator/ChunkPopulator.java +++ b/src/main/java/com/terraforged/chunk/column/ChunkPopulator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.decorator; +package com.terraforged.chunk.column; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; diff --git a/src/main/java/com/terraforged/decorator/terrain/CoastDecorator.java b/src/main/java/com/terraforged/chunk/column/CoastDecorator.java similarity index 98% rename from src/main/java/com/terraforged/decorator/terrain/CoastDecorator.java rename to src/main/java/com/terraforged/chunk/column/CoastDecorator.java index 9d9458d..1d7eb52 100644 --- a/src/main/java/com/terraforged/decorator/terrain/CoastDecorator.java +++ b/src/main/java/com/terraforged/chunk/column/CoastDecorator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.decorator.terrain; +package com.terraforged.chunk.column; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; diff --git a/src/main/java/com/terraforged/decorator/terrain/ErosionDecorator.java b/src/main/java/com/terraforged/chunk/column/ErosionDecorator.java similarity index 99% rename from src/main/java/com/terraforged/decorator/terrain/ErosionDecorator.java rename to src/main/java/com/terraforged/chunk/column/ErosionDecorator.java index e0ac4b1..93065de 100644 --- a/src/main/java/com/terraforged/decorator/terrain/ErosionDecorator.java +++ b/src/main/java/com/terraforged/chunk/column/ErosionDecorator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.decorator.terrain; +package com.terraforged.chunk.column; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; diff --git a/src/main/java/com/terraforged/decorator/terrain/GeologyDecorator.java b/src/main/java/com/terraforged/chunk/column/GeologyDecorator.java similarity index 98% rename from src/main/java/com/terraforged/decorator/terrain/GeologyDecorator.java rename to src/main/java/com/terraforged/chunk/column/GeologyDecorator.java index 9ba358c..2f37b2f 100644 --- a/src/main/java/com/terraforged/decorator/terrain/GeologyDecorator.java +++ b/src/main/java/com/terraforged/chunk/column/GeologyDecorator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.decorator.terrain; +package com.terraforged.chunk.column; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; diff --git a/src/main/java/com/terraforged/decorator/feature/LayerDecorator.java b/src/main/java/com/terraforged/chunk/column/post/LayerDecorator.java similarity index 98% rename from src/main/java/com/terraforged/decorator/feature/LayerDecorator.java rename to src/main/java/com/terraforged/chunk/column/post/LayerDecorator.java index 2c9cddb..0dca4a9 100644 --- a/src/main/java/com/terraforged/decorator/feature/LayerDecorator.java +++ b/src/main/java/com/terraforged/chunk/column/post/LayerDecorator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.decorator.feature; +package com.terraforged.chunk.column.post; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; diff --git a/src/main/java/com/terraforged/decorator/feature/SnowEroder.java b/src/main/java/com/terraforged/chunk/column/post/SnowEroder.java similarity index 97% rename from src/main/java/com/terraforged/decorator/feature/SnowEroder.java rename to src/main/java/com/terraforged/chunk/column/post/SnowEroder.java index 5749a09..81c2b8b 100644 --- a/src/main/java/com/terraforged/decorator/feature/SnowEroder.java +++ b/src/main/java/com/terraforged/chunk/column/post/SnowEroder.java @@ -23,12 +23,12 @@ * SOFTWARE. */ -package com.terraforged.decorator.feature; +package com.terraforged.chunk.column.post; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.chunk.TerraContext; -import com.terraforged.decorator.terrain.ErosionDecorator; +import com.terraforged.chunk.column.ErosionDecorator; import me.dags.noise.source.Rand; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; diff --git a/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java b/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java index 65a7d12..f64183a 100644 --- a/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java @@ -5,12 +5,12 @@ import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.api.chunk.surface.ChunkSurfaceBuffer; import com.terraforged.api.chunk.surface.SurfaceContext; import com.terraforged.chunk.TerraChunkGenerator; +import com.terraforged.chunk.column.ChunkPopulator; import com.terraforged.chunk.fix.RegionFix; import com.terraforged.chunk.util.FastChunk; import com.terraforged.chunk.util.TerraContainer; import com.terraforged.core.region.chunk.ChunkReader; import com.terraforged.feature.TerrainHelper; -import com.terraforged.decorator.ChunkPopulator; import com.terraforged.util.Environment; import net.minecraft.util.SharedSeedRandom; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/terraforged/chunk/test/Test.java b/src/main/java/com/terraforged/chunk/test/Test.java index e466db0..3c6c8c8 100644 --- a/src/main/java/com/terraforged/chunk/test/Test.java +++ b/src/main/java/com/terraforged/chunk/test/Test.java @@ -25,10 +25,10 @@ package com.terraforged.chunk.test; -import com.terraforged.biome.ModBiomes; import com.terraforged.world.terrain.Terrain; import com.terraforged.world.terrain.Terrains; import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.Biomes; public class Test { @@ -39,6 +39,6 @@ public class Test { } public static Biome getBiome() { - return ModBiomes.STEPPE; + return Biomes.PLAINS; } } diff --git a/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java b/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java index 4d7e6bb..41c9627 100644 --- a/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java +++ b/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java @@ -25,13 +25,13 @@ package com.terraforged.chunk.test; +import com.terraforged.biome.provider.BiomeProvider; +import com.terraforged.chunk.TerraChunkGenerator; +import com.terraforged.chunk.TerraContext; import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Populator; import com.terraforged.world.GeneratorContext; import com.terraforged.world.heightmap.WorldHeightmap; -import com.terraforged.biome.provider.BiomeProvider; -import com.terraforged.chunk.TerraChunkGenerator; -import com.terraforged.chunk.TerraContext; import net.minecraft.world.gen.GenerationSettings; public class TestChunkGenerator extends TerraChunkGenerator { diff --git a/src/main/java/com/terraforged/command/TerraCommand.java b/src/main/java/com/terraforged/command/TerraCommand.java index 32c29ce..bbb7894 100644 --- a/src/main/java/com/terraforged/command/TerraCommand.java +++ b/src/main/java/com/terraforged/command/TerraCommand.java @@ -31,7 +31,10 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; +import com.terraforged.Log; import com.terraforged.biome.provider.BiomeProvider; +import com.terraforged.chunk.TerraChunkGenerator; +import com.terraforged.chunk.TerraContext; import com.terraforged.command.arg.BiomeArgType; import com.terraforged.command.arg.TerrainArgType; import com.terraforged.command.search.BiomeSearchTask; @@ -39,14 +42,11 @@ import com.terraforged.command.search.BothSearchTask; import com.terraforged.command.search.Search; import com.terraforged.command.search.TerrainSearchTask; import com.terraforged.core.cell.Cell; +import com.terraforged.data.DataGen; import com.terraforged.settings.SettingsHelper; import com.terraforged.world.WorldGenerator; import com.terraforged.world.terrain.Terrain; import com.terraforged.world.terrain.Terrains; -import com.terraforged.Log; -import com.terraforged.chunk.TerraChunkGenerator; -import com.terraforged.chunk.TerraContext; -import com.terraforged.data.DataGen; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.command.arguments.ArgumentSerializer; diff --git a/src/main/java/com/terraforged/feature/context/ChanceContext.java b/src/main/java/com/terraforged/feature/context/ChanceContext.java index a3c1448..2f1edc5 100644 --- a/src/main/java/com/terraforged/feature/context/ChanceContext.java +++ b/src/main/java/com/terraforged/feature/context/ChanceContext.java @@ -3,8 +3,9 @@ package com.terraforged.feature.context; import com.terraforged.chunk.fix.RegionDelegate; import com.terraforged.chunk.util.TerraContainer; import com.terraforged.core.cell.Cell; -import com.terraforged.core.region.chunk.ChunkReader; import com.terraforged.core.concurrent.ObjectPool; +import com.terraforged.core.concurrent.Resource; +import com.terraforged.core.region.chunk.ChunkReader; import com.terraforged.world.heightmap.Levels; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; @@ -46,8 +47,11 @@ public class ChanceContext { } int nextIndex(Random random) { + if (total == 0) { + return -1; + } float value = 0F; - float chance = random.nextFloat() * total; + float chance = total * random.nextFloat(); for (int i = 0; i < length; i++) { value += buffer[i]; if (value >= chance) { @@ -57,7 +61,7 @@ public class ChanceContext { return -1; } - public static ObjectPool.Item pooled(IWorld world) { + public static Resource pooled(IWorld world) { if (world instanceof RegionDelegate) { Levels levels = new Levels(world.getMaxHeight(), world.getSeaLevel()); WorldGenRegion region = ((RegionDelegate) world).getRegion(); @@ -67,12 +71,12 @@ public class ChanceContext { return null; } - public static ObjectPool.Item pooled(IChunk chunk, Levels levels) { + public static Resource pooled(IChunk chunk, Levels levels) { BiomeContainer container = chunk.getBiomes(); if (container instanceof TerraContainer) { ChunkReader reader = ((TerraContainer) container).getChunkReader(); - ObjectPool.Item item = pool.get(); - ChanceContext context = item.getValue(); + Resource item = pool.get(); + ChanceContext context = item.get(); context.chunk = chunk; context.levels = levels; context.reader = reader; diff --git a/src/main/java/com/terraforged/feature/context/ContextSelectorFeature.java b/src/main/java/com/terraforged/feature/context/ContextSelectorFeature.java index 9d514cf..2047853 100644 --- a/src/main/java/com/terraforged/feature/context/ContextSelectorFeature.java +++ b/src/main/java/com/terraforged/feature/context/ContextSelectorFeature.java @@ -1,6 +1,6 @@ package com.terraforged.feature.context; -import com.terraforged.core.concurrent.ObjectPool; +import com.terraforged.core.concurrent.Resource; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.gen.ChunkGenerator; @@ -20,12 +20,12 @@ public class ContextSelectorFeature extends Feature { @Override public boolean place(IWorld world, ChunkGenerator generator, Random random, BlockPos pos, ContextSelectorConfig config) { - try (ObjectPool.Item item = ChanceContext.pooled(world)) { + try (Resource item = ChanceContext.pooled(world)) { if (item == null) { return false; } - ChanceContext context = item.getValue(); + ChanceContext context = item.get(); context.setPos(pos); context.init(config.features.size()); for (int i = 0; i < config.features.size(); i++) { diff --git a/src/main/java/com/terraforged/feature/context/modifier/Biome.java b/src/main/java/com/terraforged/feature/context/modifier/Biome.java index 1220609..75666ef 100644 --- a/src/main/java/com/terraforged/feature/context/modifier/Biome.java +++ b/src/main/java/com/terraforged/feature/context/modifier/Biome.java @@ -6,8 +6,8 @@ import net.minecraft.util.math.BlockPos; public class Biome extends RangeContextModifier { - public Biome(float chance, float min, float max) { - super(min, max); + public Biome(float from, float to, boolean exclusive) { + super(from, to, exclusive); } @Override @@ -21,9 +21,6 @@ public class Biome extends RangeContextModifier { } public static ContextModifier deserialize(Dynamic dynamic) { - float chance = dynamic.get("chance").asFloat(0F); - float min = dynamic.get("min").asFloat(0F); - float max = dynamic.get("max").asFloat(1F); - return new Biome(chance, min, max); + return RangeContextModifier.deserialize(dynamic, Biome::new); } } diff --git a/src/main/java/com/terraforged/feature/context/modifier/Elevation.java b/src/main/java/com/terraforged/feature/context/modifier/Elevation.java index fc893a8..4c06715 100644 --- a/src/main/java/com/terraforged/feature/context/modifier/Elevation.java +++ b/src/main/java/com/terraforged/feature/context/modifier/Elevation.java @@ -6,8 +6,8 @@ import net.minecraft.util.math.BlockPos; public class Elevation extends RangeContextModifier { - public Elevation(float min, float max) { - super(min, max); + public Elevation(float from, float to, boolean exclusive) { + super(from, to, exclusive); } @Override @@ -21,8 +21,6 @@ public class Elevation extends RangeContextModifier { } public static ContextModifier deserialize(Dynamic dynamic) { - float min = dynamic.get("min").asFloat(0F); - float max = dynamic.get("max").asFloat(1F); - return new Elevation(min, max); + return RangeContextModifier.deserialize(dynamic, Elevation::new); } } diff --git a/src/main/java/com/terraforged/feature/context/modifier/RangeContextModifier.java b/src/main/java/com/terraforged/feature/context/modifier/RangeContextModifier.java index 69e8d35..ba13f0b 100644 --- a/src/main/java/com/terraforged/feature/context/modifier/RangeContextModifier.java +++ b/src/main/java/com/terraforged/feature/context/modifier/RangeContextModifier.java @@ -9,10 +9,12 @@ import net.minecraft.util.math.BlockPos; public abstract class RangeContextModifier extends RangeModifier implements ContextModifier { - public RangeContextModifier(float min, float max) { - super(min, max); + public RangeContextModifier(float min, float max, boolean exclusive) { + super(min, max, exclusive); } + protected abstract float getValue(BlockPos pos, ChanceContext context); + @Override public float getChance(BlockPos pos, ChanceContext context) { return apply(getValue(pos, context)); @@ -21,10 +23,21 @@ public abstract class RangeContextModifier extends RangeModifier implements Cont @Override public Dynamic serialize(DynamicOps ops) { return new Dynamic<>(ops, ops.createMap(ImmutableMap.of( - ops.createString("min"), ops.createFloat(min), - ops.createString("max"), ops.createFloat(max) + ops.createString("from"), ops.createFloat(from), + ops.createString("to"), ops.createFloat(to), + ops.createString("exclusive"), ops.createBoolean(max > 0) ))); } - protected abstract float getValue(BlockPos pos, ChanceContext context); + public static T deserialize(Dynamic dynamic, Factory factory) { + float from = dynamic.get("from").asFloat(0F); + float to = dynamic.get("to").asFloat(1F); + boolean exclusive = dynamic.get("exclusive").asBoolean(false); + return factory.create(from, to, exclusive); + } + + public interface Factory { + + T create(float from, float to, boolean exclusive); + } } diff --git a/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java b/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java index 964e428..fd633c3 100644 --- a/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java +++ b/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java @@ -1,9 +1,9 @@ package com.terraforged.feature.decorator.poisson; +import com.terraforged.chunk.fix.RegionDelegate; +import com.terraforged.chunk.util.TerraContainer; import com.terraforged.core.cell.Cell; import com.terraforged.core.region.chunk.ChunkReader; -import com.terraforged.chunk.util.TerraContainer; -import com.terraforged.chunk.fix.RegionDelegate; import me.dags.noise.Module; import me.dags.noise.Source; import me.dags.noise.util.NoiseUtil; diff --git a/src/main/java/com/terraforged/feature/decorator/poisson/PoissonConfig.java b/src/main/java/com/terraforged/feature/decorator/poisson/PoissonConfig.java index ef491d4..44ba6fe 100644 --- a/src/main/java/com/terraforged/feature/decorator/poisson/PoissonConfig.java +++ b/src/main/java/com/terraforged/feature/decorator/poisson/PoissonConfig.java @@ -3,22 +3,43 @@ package com.terraforged.feature.decorator.poisson; import com.google.common.collect.ImmutableMap; import com.mojang.datafixers.Dynamic; import com.mojang.datafixers.types.DynamicOps; +import com.terraforged.core.util.poisson.PoissonContext; +import me.dags.noise.Module; +import me.dags.noise.Source; +import net.minecraft.world.IWorld; import net.minecraft.world.gen.placement.IPlacementConfig; public class PoissonConfig implements IPlacementConfig { public final int radius; public final float biomeFade; - public final int variance; - public final float min; - public final float max; + public final int densityNoiseScale; + public final float densityNoiseMin; + public final float densityNoiseMax; - public PoissonConfig(int radius, float biomeFade, int variance, float min, float max) { + public PoissonConfig(int radius, float biomeFade, int densityNoiseScale, float densityNoiseMin, float densityNoiseMax) { this.radius = radius; this.biomeFade = biomeFade; - this.variance = variance; - this.min = min; - this.max = max; + this.densityNoiseScale = densityNoiseScale; + this.densityNoiseMin = densityNoiseMin; + this.densityNoiseMax = densityNoiseMax; + } + + public void apply(IWorld world, PoissonContext context) { + Module fade = Source.ONE; + Module density = Source.ONE; + + if (biomeFade > 0.075F) { + fade = BiomeVariance.of(world, biomeFade); + } + + if (densityNoiseScale > 0) { + density = Source.simplex(context.seed, densityNoiseScale, 1) + .scale(densityNoiseMax - densityNoiseMin) + .bias(densityNoiseMin); + } + + context.density = mult(fade, density); } @Override @@ -26,20 +47,30 @@ public class PoissonConfig implements IPlacementConfig { return new Dynamic<>(ops, ops.createMap( ImmutableMap.of( ops.createString("radius"), ops.createInt(radius), - ops.createString("fade"), ops.createFloat(biomeFade), - ops.createString("scale"), ops.createInt(variance), - ops.createString("min"), ops.createFloat(min), - ops.createString("max"), ops.createFloat(max) + ops.createString("biome_fade"), ops.createFloat(biomeFade), + ops.createString("density_noise_scale"), ops.createInt(densityNoiseScale), + ops.createString("density_noise_min"), ops.createFloat(densityNoiseMin), + ops.createString("density_noise_max"), ops.createFloat(densityNoiseMax) )) ); } public static PoissonConfig deserialize(Dynamic dynamic) { int radius = dynamic.get("radius").asInt(4); - float biomeFade = dynamic.get("fade").asFloat(0.2F); - int variance = dynamic.get("scale").asInt(0); - float min = dynamic.get("min").asFloat(0F); - float max = dynamic.get("max").asFloat(1F); + float biomeFade = dynamic.get("biome_fade").asFloat(0.2F); + int variance = dynamic.get("density_noise_scale").asInt(0); + float min = dynamic.get("density_noise_min").asFloat(0F); + float max = dynamic.get("density_noise_max").asFloat(1F); return new PoissonConfig(radius, biomeFade, variance, min, max); } + + private static Module mult(Module a, Module b) { + if (a == Source.ONE) { + return b; + } + if (b == Source.ONE) { + return a; + } + return a.mult(b); + } } diff --git a/src/main/java/com/terraforged/feature/decorator/poisson/PoissonDecorator.java b/src/main/java/com/terraforged/feature/decorator/poisson/PoissonDecorator.java index e867f45..af19d68 100644 --- a/src/main/java/com/terraforged/feature/decorator/poisson/PoissonDecorator.java +++ b/src/main/java/com/terraforged/feature/decorator/poisson/PoissonDecorator.java @@ -1,9 +1,6 @@ package com.terraforged.feature.decorator.poisson; import com.terraforged.core.util.poisson.Poisson; -import com.terraforged.core.util.poisson.PoissonContext; -import me.dags.noise.Module; -import me.dags.noise.Source; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.gen.ChunkGenerator; @@ -30,7 +27,7 @@ public abstract class PoissonDecorator extends Placement { int radius = Math.max(1, Math.min(30, config.radius)); Poisson poisson = getInstance(radius); PoissonVisitor visitor = new PoissonVisitor(this, feature, world, generator, random, pos); - setVariance(world, visitor, config); + config.apply(world, visitor); int chunkX = pos.getX() >> 4; int chunkZ = pos.getZ() >> 4; poisson.visit(chunkX, chunkZ, visitor, visitor); @@ -52,20 +49,4 @@ public abstract class PoissonDecorator extends Placement { return instance; } } - - private void setVariance(IWorld world, PoissonContext context, PoissonConfig config) { - Module module = Source.ONE; - - if (config.biomeFade > 0.075F) { - module = BiomeVariance.of(world, config.biomeFade); - } - - if (config.variance > 0) { - module = module.mult(Source.simplex(context.seed, config.variance, 1) - .scale(config.max - config.min) - .bias(config.min)); - } - - context.density = module; - } } diff --git a/src/main/java/com/terraforged/feature/predicate/TreeLine.java b/src/main/java/com/terraforged/feature/predicate/TreeLine.java index d468455..c9f9c54 100644 --- a/src/main/java/com/terraforged/feature/predicate/TreeLine.java +++ b/src/main/java/com/terraforged/feature/predicate/TreeLine.java @@ -25,9 +25,9 @@ package com.terraforged.feature.predicate; +import com.terraforged.chunk.TerraContext; import com.terraforged.fm.predicate.FeaturePredicate; import com.terraforged.world.climate.Climate; -import com.terraforged.chunk.TerraContext; import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.IChunk; import net.minecraft.world.gen.Heightmap; diff --git a/src/main/java/com/terraforged/feature/sapling/SaplingConfig.java b/src/main/java/com/terraforged/feature/sapling/SaplingConfig.java index b62c5d6..919ff33 100644 --- a/src/main/java/com/terraforged/feature/sapling/SaplingConfig.java +++ b/src/main/java/com/terraforged/feature/sapling/SaplingConfig.java @@ -2,10 +2,10 @@ package com.terraforged.feature.sapling; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.terraforged.feature.BlockDataConfig; import com.terraforged.fm.template.TemplateManager; import com.terraforged.fm.template.feature.TemplateFeatureConfig; import com.terraforged.fm.util.Json; -import com.terraforged.feature.BlockDataConfig; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/com/terraforged/feature/sapling/SaplingListener.java b/src/main/java/com/terraforged/feature/sapling/SaplingListener.java index 058a13d..17972b9 100644 --- a/src/main/java/com/terraforged/feature/sapling/SaplingListener.java +++ b/src/main/java/com/terraforged/feature/sapling/SaplingListener.java @@ -28,10 +28,10 @@ package com.terraforged.feature.sapling; import com.terraforged.TerraWorld; import com.terraforged.chunk.TerraChunkGenerator; import com.terraforged.chunk.TerraContext; +import com.terraforged.feature.BlockDataManager; +import com.terraforged.fm.template.Template; import com.terraforged.fm.template.feature.TemplateFeature; import com.terraforged.fm.template.feature.TemplateFeatureConfig; -import com.terraforged.fm.template.Template; -import com.terraforged.feature.BlockDataManager; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.util.Mirror; diff --git a/src/main/java/com/terraforged/gui/ScrollPane.java b/src/main/java/com/terraforged/gui/ScrollPane.java index 8a02fa7..a9d9574 100644 --- a/src/main/java/com/terraforged/gui/ScrollPane.java +++ b/src/main/java/com/terraforged/gui/ScrollPane.java @@ -25,8 +25,8 @@ package com.terraforged.gui; -import com.terraforged.gui.preview.Preview; import com.terraforged.gui.element.Element; +import com.terraforged.gui.preview.Preview; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.IGuiEventListener; import net.minecraft.client.gui.screen.Screen; diff --git a/src/main/java/com/terraforged/gui/SettingsScreen.java b/src/main/java/com/terraforged/gui/SettingsScreen.java index 967c87a..f5ba88d 100644 --- a/src/main/java/com/terraforged/gui/SettingsScreen.java +++ b/src/main/java/com/terraforged/gui/SettingsScreen.java @@ -27,14 +27,14 @@ package com.terraforged.gui; import com.terraforged.gui.element.TerraLabel; import com.terraforged.gui.page.ClimatePage; -import com.terraforged.gui.page.Page; -import com.terraforged.gui.page.StructurePage; -import com.terraforged.gui.page.TerrainPage; -import com.terraforged.gui.preview.PreviewPage; import com.terraforged.gui.page.MiscPage; +import com.terraforged.gui.page.Page; import com.terraforged.gui.page.PresetsPage; import com.terraforged.gui.page.RiverPage; +import com.terraforged.gui.page.StructurePage; +import com.terraforged.gui.page.TerrainPage; import com.terraforged.gui.page.WorldPage; +import com.terraforged.gui.preview.PreviewPage; import com.terraforged.settings.SettingsHelper; import com.terraforged.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; diff --git a/src/main/java/com/terraforged/gui/page/ClimatePage.java b/src/main/java/com/terraforged/gui/page/ClimatePage.java index 4be8a34..dbc48cf 100644 --- a/src/main/java/com/terraforged/gui/page/ClimatePage.java +++ b/src/main/java/com/terraforged/gui/page/ClimatePage.java @@ -26,8 +26,8 @@ package com.terraforged.gui.page; import com.terraforged.core.settings.Settings; -import com.terraforged.gui.preview.PreviewPage; import com.terraforged.gui.OverlayScreen; +import com.terraforged.gui.preview.PreviewPage; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.nbt.CompoundNBT; diff --git a/src/main/java/com/terraforged/gui/page/Page.java b/src/main/java/com/terraforged/gui/page/Page.java index 4047544..50d2734 100644 --- a/src/main/java/com/terraforged/gui/page/Page.java +++ b/src/main/java/com/terraforged/gui/page/Page.java @@ -25,14 +25,14 @@ package com.terraforged.gui.page; -import com.terraforged.gui.element.TerraLabel; -import com.terraforged.gui.element.TerraSlider; -import com.terraforged.gui.element.TerraTextInput; -import com.terraforged.gui.element.TerraToggle; import com.terraforged.gui.OverlayRenderer; import com.terraforged.gui.OverlayScreen; import com.terraforged.gui.ScrollPane; import com.terraforged.gui.element.Element; +import com.terraforged.gui.element.TerraLabel; +import com.terraforged.gui.element.TerraSlider; +import com.terraforged.gui.element.TerraTextInput; +import com.terraforged.gui.element.TerraToggle; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.client.gui.IGuiEventListener; import net.minecraft.client.gui.screen.Screen; diff --git a/src/main/java/com/terraforged/gui/page/TerrainPage.java b/src/main/java/com/terraforged/gui/page/TerrainPage.java index 7975bf5..96237bb 100644 --- a/src/main/java/com/terraforged/gui/page/TerrainPage.java +++ b/src/main/java/com/terraforged/gui/page/TerrainPage.java @@ -26,8 +26,8 @@ package com.terraforged.gui.page; import com.terraforged.core.settings.Settings; -import com.terraforged.gui.preview.PreviewPage; import com.terraforged.gui.OverlayScreen; +import com.terraforged.gui.preview.PreviewPage; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.nbt.CompoundNBT; diff --git a/src/main/java/com/terraforged/gui/preview/Preview.java b/src/main/java/com/terraforged/gui/preview/Preview.java index bbbb432..cbfb13b 100644 --- a/src/main/java/com/terraforged/gui/preview/Preview.java +++ b/src/main/java/com/terraforged/gui/preview/Preview.java @@ -28,12 +28,12 @@ package com.terraforged.gui.preview; import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import com.terraforged.core.cell.Cell; +import com.terraforged.core.concurrent.cache.CacheEntry; +import com.terraforged.core.concurrent.pool.ThreadPools; import com.terraforged.core.region.Region; import com.terraforged.core.region.Size; import com.terraforged.core.region.gen.RegionGenerator; import com.terraforged.core.settings.Settings; -import com.terraforged.core.concurrent.ThreadPool; -import com.terraforged.core.concurrent.cache.CacheEntry; import com.terraforged.util.nbt.NBTHelper; import com.terraforged.world.GeneratorContext; import com.terraforged.world.continent.MutableVeci; @@ -203,7 +203,7 @@ public class Preview extends Button { context.factory.getHeightmap().getContinent().getNearestCenter(offsetX, offsetZ, center); RegionGenerator renderer = RegionGenerator.builder() - .pool(ThreadPool.getPool()) + .pool(ThreadPools.getPool()) .size(FACTOR, 0) .factory(context.factory) .batch(6) diff --git a/src/main/java/com/terraforged/material/Materials.java b/src/main/java/com/terraforged/material/Materials.java index fd3a79e..35f60c5 100644 --- a/src/main/java/com/terraforged/material/Materials.java +++ b/src/main/java/com/terraforged/material/Materials.java @@ -28,7 +28,7 @@ package com.terraforged.material; import com.terraforged.api.material.WGTags; import com.terraforged.api.material.layer.LayerManager; import com.terraforged.api.material.state.States; -import com.terraforged.core.concurrent.ObjectPool; +import com.terraforged.core.concurrent.Resource; import com.terraforged.util.DummyBlockReader; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import it.unimi.dsi.fastutil.objects.ObjectSets; @@ -98,9 +98,9 @@ public class Materials { } public static float getHardness(BlockState state) { - try (ObjectPool.Item reader = DummyBlockReader.pooled()) { - reader.getValue().set(state); - return state.getBlockHardness(reader.getValue(), BlockPos.ZERO); + try (Resource reader = DummyBlockReader.pooled()) { + reader.get().set(state); + return state.getBlockHardness(reader.get(), BlockPos.ZERO); } } } diff --git a/src/main/java/com/terraforged/material/geology/GeoManager.java b/src/main/java/com/terraforged/material/geology/GeoManager.java index 1f82bb7..d7751d6 100644 --- a/src/main/java/com/terraforged/material/geology/GeoManager.java +++ b/src/main/java/com/terraforged/material/geology/GeoManager.java @@ -27,11 +27,11 @@ package com.terraforged.material.geology; import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.geology.StrataConfig; +import com.terraforged.chunk.TerraContext; import com.terraforged.core.Seed; +import com.terraforged.material.Materials; import com.terraforged.world.geology.Geology; import com.terraforged.world.geology.Strata; -import com.terraforged.chunk.TerraContext; -import com.terraforged.material.Materials; import me.dags.noise.Module; import me.dags.noise.Source; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/terraforged/settings/DimesionSettings.java b/src/main/java/com/terraforged/settings/DimesionSettings.java index c218bcf..70ce4b2 100644 --- a/src/main/java/com/terraforged/settings/DimesionSettings.java +++ b/src/main/java/com/terraforged/settings/DimesionSettings.java @@ -1,9 +1,9 @@ package com.terraforged.settings; +import com.terraforged.TerraWorld; import com.terraforged.core.serialization.annotation.Comment; import com.terraforged.core.serialization.annotation.Range; import com.terraforged.core.serialization.annotation.Serializable; -import com.terraforged.TerraWorld; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.StringNBT; import net.minecraft.world.WorldType; diff --git a/src/main/java/com/terraforged/settings/TerraSettings.java b/src/main/java/com/terraforged/settings/TerraSettings.java index 8445f07..ec08b65 100644 --- a/src/main/java/com/terraforged/settings/TerraSettings.java +++ b/src/main/java/com/terraforged/settings/TerraSettings.java @@ -25,8 +25,8 @@ package com.terraforged.settings; -import com.terraforged.core.settings.Settings; import com.terraforged.core.serialization.annotation.Serializable; +import com.terraforged.core.settings.Settings; @Serializable public class TerraSettings extends Settings { diff --git a/src/main/java/com/terraforged/util/DummyBlockReader.java b/src/main/java/com/terraforged/util/DummyBlockReader.java index 8030e92..67d03a9 100644 --- a/src/main/java/com/terraforged/util/DummyBlockReader.java +++ b/src/main/java/com/terraforged/util/DummyBlockReader.java @@ -26,6 +26,7 @@ package com.terraforged.util; import com.terraforged.core.concurrent.ObjectPool; +import com.terraforged.core.concurrent.Resource; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.fluid.FluidState; @@ -74,7 +75,7 @@ public class DummyBlockReader implements IBlockReader { return fluid; } - public static ObjectPool.Item pooled() { + public static Resource pooled() { return pool.get(); } } diff --git a/src/main/java/com/terraforged/util/RangeModifier.java b/src/main/java/com/terraforged/util/RangeModifier.java index 3ad43c1..f6a2f53 100644 --- a/src/main/java/com/terraforged/util/RangeModifier.java +++ b/src/main/java/com/terraforged/util/RangeModifier.java @@ -2,34 +2,36 @@ package com.terraforged.util; public abstract class RangeModifier { - protected final float min; + protected final float from; + protected final float to; protected final float max; private final float range; - public RangeModifier(float min, float max) { - this.min = min; - this.max = max; - this.range = Math.abs(max - min); + public RangeModifier(float from, float max, boolean exclusive) { + this.from = from; + this.to = max; + this.max = exclusive ? 0 : 1; + this.range = Math.abs(max - from); } public float apply(float value) { - if (min < max) { - if (value <= min) { + if (from < to) { + if (value <= from) { return 0F; } - if (value >= max) { - return 1F; + if (value >= to) { + return max; } - return (value - min) / range; - } else if (min > max) { - if (value <= min) { - return 1F; + return (value - from) / range; + } else if (from > to) { + if (value <= to) { + return max; } - if (value >= max) { + if (value >= from) { return 0F; } - return 1F - (value / range); + return 1 - ((value - to) / range); } - return 1F; + return 0F; } } diff --git a/src/main/java/com/terraforged/util/setup/SetupDebug.java b/src/main/java/com/terraforged/util/setup/SetupDebug.java index 65bb703..729029a 100644 --- a/src/main/java/com/terraforged/util/setup/SetupDebug.java +++ b/src/main/java/com/terraforged/util/setup/SetupDebug.java @@ -25,8 +25,8 @@ package com.terraforged.util.setup; -import com.terraforged.api.event.SetupEvent; import com.terraforged.Log; +import com.terraforged.api.event.SetupEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; diff --git a/src/main/java/com/terraforged/util/setup/SetupHooks.java b/src/main/java/com/terraforged/util/setup/SetupHooks.java index 3b0ad80..0b4c7dc 100644 --- a/src/main/java/com/terraforged/util/setup/SetupHooks.java +++ b/src/main/java/com/terraforged/util/setup/SetupHooks.java @@ -32,8 +32,8 @@ import com.terraforged.api.chunk.surface.SurfaceManager; import com.terraforged.api.event.SetupEvent; import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.layer.LayerManager; -import com.terraforged.fm.structure.StructureManager; import com.terraforged.fm.modifier.FeatureModifiers; +import com.terraforged.fm.structure.StructureManager; import com.terraforged.world.GeneratorContext; import com.terraforged.world.terrain.provider.TerrainProvider; import net.minecraftforge.common.MinecraftForge; diff --git a/src/main/resources/data/terraforged/features/trees/birch.json b/src/main/resources/data/terraforged/features/trees/birch.json index 957fcd9..c73c3ea 100644 --- a/src/main/resources/data/terraforged/features/trees/birch.json +++ b/src/main/resources/data/terraforged/features/trees/birch.json @@ -43,10 +43,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 9, - "fade": 0.25, - "scale": 300, - "min": 0, - "max": 2 + "biome_fade": 0.25, + "density_noise_scale": 300, + "density_noise_min": 0, + "density_noise_max": 2 } } } diff --git a/src/main/resources/data/terraforged/features/trees/birch_oak.json b/src/main/resources/data/terraforged/features/trees/birch_oak.json index eb1820e..a60498c 100644 --- a/src/main/resources/data/terraforged/features/trees/birch_oak.json +++ b/src/main/resources/data/terraforged/features/trees/birch_oak.json @@ -58,10 +58,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 8, - "fade": 0.35, - "scale": 300, - "min": 0, - "max": 2 + "biome_fade": 0.35, + "density_noise_scale": 300, + "density_noise_min": 0, + "density_noise_max": 2 } } } diff --git a/src/main/resources/data/terraforged/features/trees/dark_oak.json b/src/main/resources/data/terraforged/features/trees/dark_oak.json index 4c45cda..0b71c3d 100644 --- a/src/main/resources/data/terraforged/features/trees/dark_oak.json +++ b/src/main/resources/data/terraforged/features/trees/dark_oak.json @@ -127,10 +127,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 8, - "fade": 0.4, - "scale": 200, - "min": 0, - "max": 1.85 + "biome_fade": 0.4, + "density_noise_scale": 200, + "density_noise_min": 0, + "density_noise_max": 1.85 } } } diff --git a/src/main/resources/data/terraforged/features/trees/fir_foreset.json b/src/main/resources/data/terraforged/features/trees/fir_foreset.json index 5441002..7ff93ee 100644 --- a/src/main/resources/data/terraforged/features/trees/fir_foreset.json +++ b/src/main/resources/data/terraforged/features/trees/fir_foreset.json @@ -25,10 +25,10 @@ } }, "context": { - "chance": 0.2, + "chance": 0.1, "elevation": { - "min": 0.75, - "max": 0.25 + "from": 0.55, + "to": 0.2 } } }, @@ -40,10 +40,14 @@ } }, "context": { - "chance": 0.2, + "chance": 0.25, "elevation": { - "min": 0.5, - "max": 0.0 + "from": 0.3, + "to": 0.0 + }, + "biome": { + "from": 0, + "to": 0.2 } } } @@ -53,11 +57,11 @@ "decorator": { "name": "terraforged:poisson_surface", "config": { - "radius": 6, - "fade": 0.3, - "scale": 200, - "min": 0, - "max": 2.5 + "radius": 7, + "biome_fade": 0.3, + "density_noise_scale": 300, + "density_noise_min": 0, + "density_noise_max": 2.5 } } } diff --git a/src/main/resources/data/terraforged/features/trees/flower_forest.json b/src/main/resources/data/terraforged/features/trees/flower_forest.json index 97aae28..c0eeed8 100644 --- a/src/main/resources/data/terraforged/features/trees/flower_forest.json +++ b/src/main/resources/data/terraforged/features/trees/flower_forest.json @@ -58,10 +58,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 15, - "fade": 0.3, - "scale": 500, - "min": 0.75, - "max": 2 + "biome_fade": 0.3, + "density_noise_scale": 500, + "density_noise_min": 0.75, + "density_noise_max": 2 } } } diff --git a/src/main/resources/data/terraforged/features/trees/jungle.json b/src/main/resources/data/terraforged/features/trees/jungle.json index 214ea0f..997aad0 100644 --- a/src/main/resources/data/terraforged/features/trees/jungle.json +++ b/src/main/resources/data/terraforged/features/trees/jungle.json @@ -77,10 +77,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 6, - "fade": 0.2, - "scale": 400, - "min": 0.25, - "max": 2 + "biome_fade": 0.2, + "density_noise_scale": 400, + "density_noise_min": 0.25, + "density_noise_max": 2 } } } diff --git a/src/main/resources/data/terraforged/features/trees/jungle_edge.json b/src/main/resources/data/terraforged/features/trees/jungle_edge.json index 935bd77..85c005d 100644 --- a/src/main/resources/data/terraforged/features/trees/jungle_edge.json +++ b/src/main/resources/data/terraforged/features/trees/jungle_edge.json @@ -42,10 +42,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 9, - "fade": 0.3, - "scale": 350, - "min": 0.75, - "max": 1.5 + "biome_fade": 0.3, + "density_noise_scale": 350, + "density_noise_min": 0.75, + "density_noise_max": 1.5 } } } diff --git a/src/main/resources/data/terraforged/features/trees/jungle_hills.json b/src/main/resources/data/terraforged/features/trees/jungle_hills.json index 8fe9b88..e8d69a4 100644 --- a/src/main/resources/data/terraforged/features/trees/jungle_hills.json +++ b/src/main/resources/data/terraforged/features/trees/jungle_hills.json @@ -76,10 +76,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 8, - "fade": 0.2, - "scale": 200, - "min": 0.35, - "max": 1.85 + "biome_fade": 0.2, + "density_noise_scale": 200, + "density_noise_min": 0.35, + "density_noise_max": 1.85 } } } diff --git a/src/main/resources/data/terraforged/features/trees/oak_forest.json b/src/main/resources/data/terraforged/features/trees/oak_forest.json index 4881be2..a165f30 100644 --- a/src/main/resources/data/terraforged/features/trees/oak_forest.json +++ b/src/main/resources/data/terraforged/features/trees/oak_forest.json @@ -42,9 +42,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 9, - "scale": 150, - "min": 0.15, - "max": 1.75 + "biome_fade": 0.2, + "density_noise_scale": 150, + "density_noise_min": 0.15, + "density_noise_max": 1.75 } } } diff --git a/src/main/resources/data/terraforged/features/trees/pine.json b/src/main/resources/data/terraforged/features/trees/pine.json index f38787b..acb80ed 100644 --- a/src/main/resources/data/terraforged/features/trees/pine.json +++ b/src/main/resources/data/terraforged/features/trees/pine.json @@ -38,10 +38,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 10, - "fade": 0.25, - "scale": 250, - "min": 0.0, - "max": 2.75 + "biome_fade": 0.25, + "density_noise_scale": 250, + "density_noise_min": 0.0, + "density_noise_max": 2.75 } } } diff --git a/src/main/resources/data/terraforged/features/trees/redwood.json b/src/main/resources/data/terraforged/features/trees/redwood.json index 93b8260..83fd9fe 100644 --- a/src/main/resources/data/terraforged/features/trees/redwood.json +++ b/src/main/resources/data/terraforged/features/trees/redwood.json @@ -11,47 +11,88 @@ "name": "minecraft:decorated", "config": { "feature": { - "name": "minecraft:random_selector", + "name": "terraforged:context_selector", "config": { "features": [ { - "name": "terraforged:template", - "config": { - "template": "terraforged:redwood_huge" + "feature": { + "name": "terraforged:template", + "config": { + "template": "terraforged:redwood_huge" + } }, - "chance": 0.025641026 + "context": { + "chance": 0.4, + "elevation": { + "from": 0.15, + "to": 0.0 + }, + "biome": { + "from": 0.1, + "to": 0.4 + } + } }, { - "name": "terraforged:template", - "config": { - "template": "terraforged:pine" + "feature": { + "name": "terraforged:template", + "config": { + "template": "terraforged:redwood_large" + } }, - "chance": 0.15 + "context": { + "chance": 0.2, + "elevation": { + "from": 0.25, + "to": 0.0 + } + }, + "biome": { + "from": 0.0, + "to": 0.25 + } }, { - "name": "terraforged:template", - "config": { - "template": "terraforged:redwood_large" + "feature": { + "name": "terraforged:template", + "config": { + "template": "terraforged:spruce_large" + } }, - "chance": 0.33333334 + "context": { + "chance": 0.4, + "elevation": { + "from": 0.35, + "to": 0.15 + } + } + }, + { + "feature": { + "name": "terraforged:template", + "config": { + "template": "terraforged:spruce_small" + } + }, + "context": { + "chance": 0.2, + "elevation": { + "from": 0.50, + "to": 0.2 + } + } } - ], - "default": { - "name": "terraforged:template", - "config": { - "template": "terraforged:redwood_large" - } - } + ] } }, "decorator": { "name": "terraforged:poisson_surface", "config": { - "radius": 9, - "fade": 0.2, - "scale": 250, - "min": 0.15, - "max": 2.25 + "radius": 8, + "biome_fade": 0.2, + "density_noise_scale": 250, + "density_noise_min": 0.15, + "density_noise_max": 2.25 } } } diff --git a/src/main/resources/data/terraforged/features/trees/spruce.json b/src/main/resources/data/terraforged/features/trees/spruce.json index d8809db..8654c26 100644 --- a/src/main/resources/data/terraforged/features/trees/spruce.json +++ b/src/main/resources/data/terraforged/features/trees/spruce.json @@ -38,10 +38,10 @@ "name": "terraforged:poisson_surface", "config": { "radius": 10, - "fade": 0.3, - "scale": 250, - "min": 0.15, - "max": 1.75 + "biome_fade": 0.3, + "density_noise_scale": 250, + "density_noise_min": 0.15, + "density_noise_max": 1.75 } } } diff --git a/src/main/resources/redwood.json b/src/main/resources/redwood.json new file mode 100644 index 0000000..b8f3dc5 --- /dev/null +++ b/src/main/resources/redwood.json @@ -0,0 +1,59 @@ +{ + "biomes": [ + "minecraft:*" + ], + "match": [ + [ + "minecraft:mega_spruce_tree" + ] + ], + "replace": { + "name": "minecraft:decorated", + "config": { + "feature": { + "name": "minecraft:random_selector", + "config": { + "features": [ + { + "name": "terraforged:template", + "config": { + "template": "terraforged:redwood_huge" + }, + "chance": 0.025641026 + }, + { + "name": "terraforged:template", + "config": { + "template": "terraforged:pine" + }, + "chance": 0.15 + }, + { + "name": "terraforged:template", + "config": { + "template": "terraforged:redwood_large" + }, + "chance": 0.33333334 + } + ], + "default": { + "name": "terraforged:template", + "config": { + "template": "terraforged:redwood_large" + } + } + } + }, + "decorator": { + "name": "terraforged:poisson_surface", + "config": { + "radius": 9, + "biome_fade": 0.2, + "density_noise_scale": 250, + "density_noise_min": 0.15, + "density_noise_max": 2.25 + } + } + } + } +} \ No newline at end of file