From 38dc1c92616897aeeeb5c542042e4d1f4846b0c7 Mon Sep 17 00:00:00 2001 From: dags- Date: Fri, 12 Jun 2020 00:53:59 +0100 Subject: [PATCH] update n2d package --- Engine | 2 +- FeatureManager | 2 +- .../modifier/AbstractMaxHeightModifier.java | 4 +- .../api/chunk/column/ColumnDecorator.java | 4 +- .../api/material/geology/StrataConfig.java | 2 +- .../api/material/layer/LayerMaterial.java | 2 +- .../terraforged/biome/map/SimpleBiomeMap.java | 2 +- .../terraforged/biome/map/set/BiomeSet.java | 2 +- .../modifier/AbstractMaxHeightModifier.java | 4 +- .../biome/modifier/BeachModifier.java | 4 +- .../biome/provider/BiomeHelper.java | 2 +- .../biome/surface/BriceSurface.java | 6 +- .../biome/surface/DunesSurface.java | 8 +- .../biome/surface/ForestSurface.java | 4 +- .../biome/surface/IcebergsSurface.java | 6 +- .../biome/surface/SteppeSurface.java | 6 +- .../chunk/TerraChunkGenerator.java | 19 ++-- .../chunk/column/post/SnowEroder.java | 2 +- .../chunk/generator/BiomeGenerator.java | 3 +- .../chunk/generator/FeatureGenerator.java | 3 +- .../chunk/generator/Generator.java | 89 +++++++++++++++++++ .../chunk/generator/MobGenerator.java | 9 +- .../chunk/generator/StructureGenerator.java | 3 +- .../chunk/generator/SurfaceGenerator.java | 3 +- .../chunk/generator/TerrainCarver.java | 3 +- .../chunk/generator/TerrainGenerator.java | 3 +- .../com/terraforged/command/TerraCommand.java | 2 +- .../terraforged/feature/TerrainHelper.java | 2 +- .../decorator/poisson/BiomeVariance.java | 6 +- .../decorator/poisson/PoissonConfig.java | 4 +- .../feature/feature/DiskFeature.java | 4 +- .../com/terraforged/gui/preview/Preview.java | 2 +- .../terraforged/gui/preview/RenderMode.java | 2 +- .../material/geology/GeoGenerator.java | 2 +- .../material/geology/GeoManager.java | 4 +- .../java/com/terraforged/util/ListUtils.java | 2 +- .../terraforged/util/setup/SetupDebug.java | 4 +- 37 files changed, 165 insertions(+), 66 deletions(-) create mode 100644 src/main/java/com/terraforged/chunk/generator/Generator.java diff --git a/Engine b/Engine index 82bcd43..86578fa 160000 --- a/Engine +++ b/Engine @@ -1 +1 @@ -Subproject commit 82bcd434921697fb51fd272d65ed6f10ec79ab22 +Subproject commit 86578fa35c0c296487d1aac675b55d4eb994cde7 diff --git a/FeatureManager b/FeatureManager index 5411388..96704f5 160000 --- a/FeatureManager +++ b/FeatureManager @@ -1 +1 @@ -Subproject commit 5411388286fbf68e37213f467cfea38c937051c6 +Subproject commit 96704f55881abe69c1a20462cccb83004bd15a9a 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 4aa62f8..5642e0f 100644 --- a/src/main/java/com/terraforged/api/biome/modifier/AbstractMaxHeightModifier.java +++ b/src/main/java/com/terraforged/api/biome/modifier/AbstractMaxHeightModifier.java @@ -28,8 +28,8 @@ package com.terraforged.api.biome.modifier; 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; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; import net.minecraft.world.biome.Biome; public abstract class AbstractMaxHeightModifier extends AbstractOffsetModifier { diff --git a/src/main/java/com/terraforged/api/chunk/column/ColumnDecorator.java b/src/main/java/com/terraforged/api/chunk/column/ColumnDecorator.java index e1d0dbf..a251995 100644 --- a/src/main/java/com/terraforged/api/chunk/column/ColumnDecorator.java +++ b/src/main/java/com/terraforged/api/chunk/column/ColumnDecorator.java @@ -26,8 +26,8 @@ package com.terraforged.api.chunk.column; import com.terraforged.api.chunk.surface.ChunkSurfaceBuffer; -import me.dags.noise.Source; -import me.dags.noise.source.FastSource; +import com.terraforged.n2d.Source; +import com.terraforged.n2d.source.FastSource; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.chunk.IChunk; diff --git a/src/main/java/com/terraforged/api/material/geology/StrataConfig.java b/src/main/java/com/terraforged/api/material/geology/StrataConfig.java index 58ee8b2..8078601 100644 --- a/src/main/java/com/terraforged/api/material/geology/StrataConfig.java +++ b/src/main/java/com/terraforged/api/material/geology/StrataConfig.java @@ -25,7 +25,7 @@ package com.terraforged.api.material.geology; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; public class StrataConfig { diff --git a/src/main/java/com/terraforged/api/material/layer/LayerMaterial.java b/src/main/java/com/terraforged/api/material/layer/LayerMaterial.java index 29705cd..eae3c01 100644 --- a/src/main/java/com/terraforged/api/material/layer/LayerMaterial.java +++ b/src/main/java/com/terraforged/api/material/layer/LayerMaterial.java @@ -25,7 +25,7 @@ package com.terraforged.api.material.layer; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; diff --git a/src/main/java/com/terraforged/biome/map/SimpleBiomeMap.java b/src/main/java/com/terraforged/biome/map/SimpleBiomeMap.java index d2bc26c..5bc437e 100644 --- a/src/main/java/com/terraforged/biome/map/SimpleBiomeMap.java +++ b/src/main/java/com/terraforged/biome/map/SimpleBiomeMap.java @@ -11,7 +11,7 @@ import com.terraforged.core.cell.Cell; import com.terraforged.world.biome.BiomeType; import com.terraforged.world.heightmap.Levels; import com.terraforged.world.terrain.TerrainType; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.world.biome.Biome; import java.util.Arrays; diff --git a/src/main/java/com/terraforged/biome/map/set/BiomeSet.java b/src/main/java/com/terraforged/biome/map/set/BiomeSet.java index 7c408e9..ee41ccc 100644 --- a/src/main/java/com/terraforged/biome/map/set/BiomeSet.java +++ b/src/main/java/com/terraforged/biome/map/set/BiomeSet.java @@ -5,7 +5,7 @@ import com.terraforged.biome.map.defaults.DefaultBiome; import com.terraforged.biome.provider.BiomeHelper; import com.terraforged.core.cell.Cell; import com.terraforged.util.ListUtils; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.world.biome.Biome; import java.util.Collections; diff --git a/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java b/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java index d77534b..10d0880 100644 --- a/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java +++ b/src/main/java/com/terraforged/biome/modifier/AbstractMaxHeightModifier.java @@ -28,8 +28,8 @@ package com.terraforged.biome.modifier; 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; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; import net.minecraft.world.biome.Biome; public abstract class AbstractMaxHeightModifier extends AbstractOffsetModifier { diff --git a/src/main/java/com/terraforged/biome/modifier/BeachModifier.java b/src/main/java/com/terraforged/biome/modifier/BeachModifier.java index 234ae34..325ff06 100644 --- a/src/main/java/com/terraforged/biome/modifier/BeachModifier.java +++ b/src/main/java/com/terraforged/biome/modifier/BeachModifier.java @@ -6,8 +6,8 @@ import com.terraforged.core.cell.Cell; import com.terraforged.world.GeneratorContext; import com.terraforged.world.biome.BiomeType; import com.terraforged.world.terrain.Terrains; -import me.dags.noise.Module; -import me.dags.noise.Source; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; diff --git a/src/main/java/com/terraforged/biome/provider/BiomeHelper.java b/src/main/java/com/terraforged/biome/provider/BiomeHelper.java index e4ea305..fa43e6d 100644 --- a/src/main/java/com/terraforged/biome/provider/BiomeHelper.java +++ b/src/main/java/com/terraforged/biome/provider/BiomeHelper.java @@ -31,7 +31,7 @@ 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 com.terraforged.n2d.util.Vec2f; import net.minecraft.util.ResourceLocation; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; diff --git a/src/main/java/com/terraforged/biome/surface/BriceSurface.java b/src/main/java/com/terraforged/biome/surface/BriceSurface.java index 07b9f71..53e4fd0 100644 --- a/src/main/java/com/terraforged/biome/surface/BriceSurface.java +++ b/src/main/java/com/terraforged/biome/surface/BriceSurface.java @@ -5,9 +5,9 @@ import com.terraforged.api.chunk.surface.SurfaceContext; import com.terraforged.core.Seed; import com.terraforged.core.util.Variance; import com.terraforged.world.geology.Strata; -import me.dags.noise.Module; -import me.dags.noise.Source; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; diff --git a/src/main/java/com/terraforged/biome/surface/DunesSurface.java b/src/main/java/com/terraforged/biome/surface/DunesSurface.java index 211460f..1c99d57 100644 --- a/src/main/java/com/terraforged/biome/surface/DunesSurface.java +++ b/src/main/java/com/terraforged/biome/surface/DunesSurface.java @@ -34,10 +34,10 @@ import com.terraforged.chunk.TerraContext; import com.terraforged.core.cell.Cell; import com.terraforged.world.heightmap.Levels; import com.terraforged.world.terrain.Terrains; -import me.dags.noise.Module; -import me.dags.noise.Source; -import me.dags.noise.func.CellFunc; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; +import com.terraforged.n2d.func.CellFunc; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/terraforged/biome/surface/ForestSurface.java b/src/main/java/com/terraforged/biome/surface/ForestSurface.java index 7addf05..81ee423 100644 --- a/src/main/java/com/terraforged/biome/surface/ForestSurface.java +++ b/src/main/java/com/terraforged/biome/surface/ForestSurface.java @@ -4,8 +4,8 @@ import com.terraforged.api.chunk.surface.Surface; import com.terraforged.api.chunk.surface.SurfaceContext; import com.terraforged.api.material.state.States; import com.terraforged.world.GeneratorContext; -import me.dags.noise.Module; -import me.dags.noise.Source; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.world.gen.Heightmap; diff --git a/src/main/java/com/terraforged/biome/surface/IcebergsSurface.java b/src/main/java/com/terraforged/biome/surface/IcebergsSurface.java index bf6e2c3..df0527c 100644 --- a/src/main/java/com/terraforged/biome/surface/IcebergsSurface.java +++ b/src/main/java/com/terraforged/biome/surface/IcebergsSurface.java @@ -31,9 +31,9 @@ import com.terraforged.api.material.state.States; import com.terraforged.chunk.TerraContext; import com.terraforged.core.cell.Cell; import com.terraforged.world.heightmap.Levels; -import me.dags.noise.Module; -import me.dags.noise.Source; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; diff --git a/src/main/java/com/terraforged/biome/surface/SteppeSurface.java b/src/main/java/com/terraforged/biome/surface/SteppeSurface.java index 1a9beaf..8b0a37d 100644 --- a/src/main/java/com/terraforged/biome/surface/SteppeSurface.java +++ b/src/main/java/com/terraforged/biome/surface/SteppeSurface.java @@ -3,9 +3,9 @@ package com.terraforged.biome.surface; import com.terraforged.api.chunk.surface.Surface; import com.terraforged.api.chunk.surface.SurfaceContext; import com.terraforged.api.material.state.States; -import me.dags.noise.Module; -import me.dags.noise.Source; -import me.dags.noise.func.CellFunc; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; +import com.terraforged.n2d.func.CellFunc; import net.minecraft.block.BlockState; public class SteppeSurface implements Surface { diff --git a/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java b/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java index 78f4431..27fb0c3 100644 --- a/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java +++ b/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java @@ -31,6 +31,7 @@ import com.terraforged.api.material.layer.LayerManager; import com.terraforged.biome.provider.BiomeProvider; import com.terraforged.chunk.generator.BiomeGenerator; import com.terraforged.chunk.generator.FeatureGenerator; +import com.terraforged.chunk.generator.Generator; import com.terraforged.chunk.generator.MobGenerator; import com.terraforged.chunk.generator.StructureGenerator; import com.terraforged.chunk.generator.SurfaceGenerator; @@ -69,13 +70,13 @@ public class TerraChunkGenerator extends ChunkGenerator { private final TerraContext context; private final BiomeProvider biomeProvider; - private final MobGenerator mobGenerator; - private final BiomeGenerator biomeGenerator; - private final TerrainCarver terrainCarver; - private final TerrainGenerator terrainGenerator; - private final SurfaceGenerator surfaceGenerator; - private final FeatureGenerator featureGenerator; - private final StructureGenerator structureGenerator; + private final Generator.Mobs mobGenerator; + private final Generator.Biomes biomeGenerator; + private final Generator.Carvers terrainCarver; + private final Generator.Terrain terrainGenerator; + private final Generator.Surfaces surfaceGenerator; + private final Generator.Features featureGenerator; + private final Generator.Structures structureGenerator; private final GeoManager geologyManager; private final FeatureManager featureManager; @@ -159,12 +160,12 @@ public class TerraChunkGenerator extends ChunkGenerator { @Override public final void spawnMobs(ServerWorld worldIn, boolean hostile, boolean peaceful) { - mobGenerator.spawnMobs(worldIn, hostile, peaceful); + mobGenerator.tickSpawners(worldIn, hostile, peaceful); } @Override public final List getPossibleCreatures(EntityClassification type, BlockPos pos) { - return mobGenerator.getPossibleCreatures(world, type, pos); + return mobGenerator.getSpawns(world, type, pos); } @Override diff --git a/src/main/java/com/terraforged/chunk/column/post/SnowEroder.java b/src/main/java/com/terraforged/chunk/column/post/SnowEroder.java index ab00cd9..298201a 100644 --- a/src/main/java/com/terraforged/chunk/column/post/SnowEroder.java +++ b/src/main/java/com/terraforged/chunk/column/post/SnowEroder.java @@ -29,7 +29,7 @@ import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.chunk.TerraContext; import com.terraforged.chunk.column.ErosionDecorator; -import me.dags.noise.source.Rand; +import com.terraforged.n2d.source.Rand; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.GrassBlock; diff --git a/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java b/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java index 4484765..fe68afc 100644 --- a/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java @@ -9,7 +9,7 @@ import net.minecraft.util.math.ChunkPos; import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.IChunk; -public class BiomeGenerator { +public class BiomeGenerator implements Generator.Biomes { private final TerraChunkGenerator generator; private final BiomeProvider biomeProvider; @@ -19,6 +19,7 @@ public class BiomeGenerator { this.biomeProvider = generator.getBiomeProvider(); } + @Override public void generateBiomes(IChunk chunk) { ChunkPos pos = chunk.getPos(); try (ChunkReader reader = generator.getChunkReader(pos.x, pos.z)) { diff --git a/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java b/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java index 37e52d0..1fbfe17 100644 --- a/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java @@ -17,7 +17,7 @@ import net.minecraft.world.gen.WorldGenRegion; import java.util.List; -public class FeatureGenerator { +public class FeatureGenerator implements Generator.Features { private final TerraChunkGenerator generator; @@ -25,6 +25,7 @@ public class FeatureGenerator { this.generator = generator; } + @Override public final void generateFeatures(WorldGenRegion region) { int chunkX = region.getMainChunkX(); int chunkZ = region.getMainChunkZ(); diff --git a/src/main/java/com/terraforged/chunk/generator/Generator.java b/src/main/java/com/terraforged/chunk/generator/Generator.java new file mode 100644 index 0000000..b5f9866 --- /dev/null +++ b/src/main/java/com/terraforged/chunk/generator/Generator.java @@ -0,0 +1,89 @@ +package com.terraforged.chunk.generator; + +import net.minecraft.entity.EntityClassification; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.BiomeManager; +import net.minecraft.world.chunk.IChunk; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.WorldGenRegion; +import net.minecraft.world.gen.feature.template.TemplateManager; +import net.minecraft.world.server.ServerWorld; + +import java.util.List; + +public interface Generator { + + interface Biomes { + + /** + * Generates the biomes for this chunk + */ + void generateBiomes(IChunk chunk); + } + + interface Terrain { + + /** + * Generates the basic heightmap and populates with stone/water/bedrock accordinly + */ + void generateTerrain(IWorld world, IChunk chunk); + } + + interface Features { + + /** + * Places biome specific features into the center-chunk of the world gen region + * The region consists of the center chunk (the chunk being generated) and it's 8 neighbouring chunks (citation needed) + */ + void generateFeatures(WorldGenRegion region); + } + + interface Structures { + + /** + * Determines where structures will be placed during chunk gen + */ + void generateStructureStarts(BiomeManager biomes, IChunk chunk, TemplateManager templates); + + /** + * Determines where individual structure pieces will be placed based on the start positions + */ + void generateStructureReferences(IWorld world, IChunk chunk); + } + + interface Surfaces { + + /** + * Applies biome specific surface generation during chunk gen + */ + void generateSurface(WorldGenRegion world, IChunk chunk); + } + + interface Carvers { + + /** + * Cuts caves/ravines during chunk gen according to the carving stage + */ + void carveTerrain(BiomeManager biomes, IChunk chunk, GenerationStage.Carving type); + } + + interface Mobs { + + /** + * Spawns mobs during chunk gen + */ + void generateMobs(WorldGenRegion region); + + /** + * Ticks the worlds mob spawners post chunk gen + */ + void tickSpawners(ServerWorld world, boolean hostile, boolean peaceful); + + /** + * Gets a list of possible spawns at the given position + */ + List getSpawns(IWorld world, EntityClassification type, BlockPos pos); + } +} diff --git a/src/main/java/com/terraforged/chunk/generator/MobGenerator.java b/src/main/java/com/terraforged/chunk/generator/MobGenerator.java index d35a2ef..24b0d3f 100644 --- a/src/main/java/com/terraforged/chunk/generator/MobGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/MobGenerator.java @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.Mod; import java.util.List; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) -public class MobGenerator { +public class MobGenerator implements Generator.Mobs { // may be accessed cross-thread private static volatile boolean mobSpawning = true; @@ -35,6 +35,7 @@ public class MobGenerator { this.generator = generator; } + @Override public final void generateMobs(WorldGenRegion region) { // vanilla does NOT check the mobSpawning gamerule before calling this if (MobGenerator.mobSpawning) { @@ -47,13 +48,15 @@ public class MobGenerator { } } - public final void spawnMobs(ServerWorld world, boolean hostile, boolean peaceful) { + @Override + public final void tickSpawners(ServerWorld world, boolean hostile, boolean peaceful) { phantomSpawner.tick(world, hostile, peaceful); patrolSpawner.tick(world, hostile, peaceful); catSpawner.tick(world, hostile, peaceful); } - public final List getPossibleCreatures(IWorld world, EntityClassification type, BlockPos pos) { + @Override + public final List getSpawns(IWorld world, EntityClassification type, BlockPos pos) { if (Feature.SWAMP_HUT.func_202383_b(world, pos)) { if (type == EntityClassification.MONSTER) { return Feature.SWAMP_HUT.getSpawnList(); diff --git a/src/main/java/com/terraforged/chunk/generator/StructureGenerator.java b/src/main/java/com/terraforged/chunk/generator/StructureGenerator.java index fe2a12b..7556626 100644 --- a/src/main/java/com/terraforged/chunk/generator/StructureGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/StructureGenerator.java @@ -18,7 +18,7 @@ import net.minecraft.world.gen.feature.template.TemplateManager; import java.util.Map; -public class StructureGenerator { +public class StructureGenerator implements Generator.Structures { private final TerraChunkGenerator generator; @@ -26,6 +26,7 @@ public class StructureGenerator { this.generator = generator; } + @Override public void generateStructureStarts(BiomeManager biomes, IChunk chunk, TemplateManager templates) { ChunkPos chunkpos = chunk.getPos(); generator.queueChunk(chunkpos.x, chunkpos.z); diff --git a/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java b/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java index 9e9ac98..c406cd3 100644 --- a/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java @@ -14,7 +14,7 @@ import net.minecraft.world.gen.INoiseGenerator; import net.minecraft.world.gen.PerlinNoiseGenerator; import net.minecraft.world.gen.WorldGenRegion; -public class SurfaceGenerator { +public class SurfaceGenerator implements Generator.Surfaces { private final TerraChunkGenerator generator; private final INoiseGenerator surfaceNoise; @@ -24,6 +24,7 @@ public class SurfaceGenerator { this.surfaceNoise = new PerlinNoiseGenerator(new SharedSeedRandom(generator.getSeed()), 3, 0); } + @Override public final void generateSurface(WorldGenRegion world, IChunk chunk) { try (ChunkReader reader = generator.getChunkReader(chunk.getPos().x, chunk.getPos().z)) { TerraContainer container = TerraContainer.getOrCreate(chunk, reader, generator.getBiomeProvider()); diff --git a/src/main/java/com/terraforged/chunk/generator/TerrainCarver.java b/src/main/java/com/terraforged/chunk/generator/TerrainCarver.java index 92d5fd1..fcc394e 100644 --- a/src/main/java/com/terraforged/chunk/generator/TerrainCarver.java +++ b/src/main/java/com/terraforged/chunk/generator/TerrainCarver.java @@ -14,7 +14,7 @@ import net.minecraft.world.gen.carver.ConfiguredCarver; import java.util.BitSet; import java.util.ListIterator; -public class TerrainCarver { +public class TerrainCarver implements Generator.Carvers { private final TerraChunkGenerator generator; @@ -22,6 +22,7 @@ public class TerrainCarver { this.generator = generator; } + @Override public void carveTerrain(BiomeManager biomes, IChunk chunk, GenerationStage.Carving type) { if (StructureUtils.hasOvergroundStructure(chunk)) { return; diff --git a/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java b/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java index 58b4457..9662e0a 100644 --- a/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java @@ -13,7 +13,7 @@ import com.terraforged.world.terrain.Terrains; import net.minecraft.world.IWorld; import net.minecraft.world.chunk.IChunk; -public class TerrainGenerator { +public class TerrainGenerator implements Generator.Terrain { private final Levels levels; private final Climate climate; @@ -29,6 +29,7 @@ public class TerrainGenerator { this.terrainHelper = new TerrainHelper(0.75F); } + @Override public final void generateTerrain(IWorld world, IChunk chunk) { try (ChunkReader reader = generator.getChunkReader(chunk.getPos().x, chunk.getPos().z)) { TerraContainer container = TerraContainer.getOrCreate(chunk, reader, generator.getBiomeProvider()); diff --git a/src/main/java/com/terraforged/command/TerraCommand.java b/src/main/java/com/terraforged/command/TerraCommand.java index 318b5e3..c823634 100644 --- a/src/main/java/com/terraforged/command/TerraCommand.java +++ b/src/main/java/com/terraforged/command/TerraCommand.java @@ -305,7 +305,7 @@ public class TerraCommand { return TextComponentUtils.wrapInSquareBrackets(new TranslationTextComponent( "chat.coordinates", pos.getX(), "~", pos.getZ() )).applyTextStyle((style) -> style.setColor(TextFormatting.GREEN) - .setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/tp @s " + pos.getX() + " ~ " + pos.getZ())) + .setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/tp @s " + pos.getX() + " " + pos.getY() + " " + pos.getZ())) .setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TranslationTextComponent("chat.coordinates.tooltip"))) ); } diff --git a/src/main/java/com/terraforged/feature/TerrainHelper.java b/src/main/java/com/terraforged/feature/TerrainHelper.java index 02143b3..eb098f9 100644 --- a/src/main/java/com/terraforged/feature/TerrainHelper.java +++ b/src/main/java/com/terraforged/feature/TerrainHelper.java @@ -30,7 +30,7 @@ import it.unimi.dsi.fastutil.longs.LongIterator; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; import it.unimi.dsi.fastutil.objects.ObjectListIterator; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.block.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; 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 a337170..6902329 100644 --- a/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java +++ b/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java @@ -3,9 +3,9 @@ package com.terraforged.feature.decorator.poisson; import com.terraforged.chunk.TerraChunkGenerator; import com.terraforged.core.cell.Cell; import com.terraforged.core.region.chunk.ChunkReader; -import me.dags.noise.Module; -import me.dags.noise.Source; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.world.IWorld; import net.minecraft.world.gen.ChunkGenerator; 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 b4e0b0d..3bf09e3 100644 --- a/src/main/java/com/terraforged/feature/decorator/poisson/PoissonConfig.java +++ b/src/main/java/com/terraforged/feature/decorator/poisson/PoissonConfig.java @@ -4,8 +4,8 @@ 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 com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; import net.minecraft.world.IWorld; import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.gen.placement.IPlacementConfig; diff --git a/src/main/java/com/terraforged/feature/feature/DiskFeature.java b/src/main/java/com/terraforged/feature/feature/DiskFeature.java index dcc2f1d..cd39b72 100644 --- a/src/main/java/com/terraforged/feature/feature/DiskFeature.java +++ b/src/main/java/com/terraforged/feature/feature/DiskFeature.java @@ -1,7 +1,7 @@ package com.terraforged.feature.feature; -import me.dags.noise.Module; -import me.dags.noise.Source; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; import net.minecraft.block.BlockState; import net.minecraft.tags.FluidTags; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/terraforged/gui/preview/Preview.java b/src/main/java/com/terraforged/gui/preview/Preview.java index 143bb07..e3d891b 100644 --- a/src/main/java/com/terraforged/gui/preview/Preview.java +++ b/src/main/java/com/terraforged/gui/preview/Preview.java @@ -39,7 +39,7 @@ import com.terraforged.world.GeneratorContext; import com.terraforged.world.continent.MutableVeci; import com.terraforged.world.heightmap.Levels; import com.terraforged.world.terrain.Terrains; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/com/terraforged/gui/preview/RenderMode.java b/src/main/java/com/terraforged/gui/preview/RenderMode.java index f420cd7..dcb19cf 100644 --- a/src/main/java/com/terraforged/gui/preview/RenderMode.java +++ b/src/main/java/com/terraforged/gui/preview/RenderMode.java @@ -27,7 +27,7 @@ package com.terraforged.gui.preview; import com.terraforged.core.cell.Cell; import com.terraforged.world.heightmap.Levels; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; import java.awt.*; diff --git a/src/main/java/com/terraforged/material/geology/GeoGenerator.java b/src/main/java/com/terraforged/material/geology/GeoGenerator.java index 57a0299..4c6f2e3 100644 --- a/src/main/java/com/terraforged/material/geology/GeoGenerator.java +++ b/src/main/java/com/terraforged/material/geology/GeoGenerator.java @@ -29,7 +29,7 @@ import com.terraforged.api.material.geology.StrataConfig; import com.terraforged.api.material.geology.StrataGenerator; import com.terraforged.material.Materials; import com.terraforged.world.geology.Strata; -import me.dags.noise.Source; +import com.terraforged.n2d.Source; import net.minecraft.block.Block; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/terraforged/material/geology/GeoManager.java b/src/main/java/com/terraforged/material/geology/GeoManager.java index d7751d6..0a8d59f 100644 --- a/src/main/java/com/terraforged/material/geology/GeoManager.java +++ b/src/main/java/com/terraforged/material/geology/GeoManager.java @@ -32,8 +32,8 @@ import com.terraforged.core.Seed; import com.terraforged.material.Materials; import com.terraforged.world.geology.Geology; import com.terraforged.world.geology.Strata; -import me.dags.noise.Module; -import me.dags.noise.Source; +import com.terraforged.n2d.Module; +import com.terraforged.n2d.Source; import net.minecraft.block.BlockState; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/util/ListUtils.java b/src/main/java/com/terraforged/util/ListUtils.java index 1be8e94..b7a171f 100644 --- a/src/main/java/com/terraforged/util/ListUtils.java +++ b/src/main/java/com/terraforged/util/ListUtils.java @@ -25,7 +25,7 @@ package com.terraforged.util; -import me.dags.noise.util.NoiseUtil; +import com.terraforged.n2d.util.NoiseUtil; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/com/terraforged/util/setup/SetupDebug.java b/src/main/java/com/terraforged/util/setup/SetupDebug.java index 838716a..44b991a 100644 --- a/src/main/java/com/terraforged/util/setup/SetupDebug.java +++ b/src/main/java/com/terraforged/util/setup/SetupDebug.java @@ -29,8 +29,8 @@ 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 com.terraforged.n2d.Source; +import com.terraforged.n2d.source.Builder; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.world.biome.Biomes;