From f46272b4e4acb8067219fc5d33217f56a39c0977 Mon Sep 17 00:00:00 2001 From: dags- Date: Sat, 20 Jun 2020 12:38:44 +0100 Subject: [PATCH] Region -> Tile --- Engine | 2 +- .../assets/terraforged/lang/en_us.json | 13 ++++++- .../java/com/terraforged/TerraForgedMod.java | 2 +- src/main/java/com/terraforged/TerraWorld.java | 6 ++-- .../chunk/TerraChunkGenerator.java | 28 +++++++-------- .../com/terraforged/chunk/TerraContext.java | 10 +++--- .../terraforged/chunk/TerraGenSettings.java | 2 +- .../chunk/generator/BiomeGenerator.java | 2 +- .../chunk/generator/FeatureGenerator.java | 2 +- .../chunk/generator/SurfaceGenerator.java | 2 +- .../chunk/generator/TerrainGenerator.java | 2 +- .../settings/DimesionSettings.java | 2 +- .../{ => chunk}/settings/Miscellaneous.java | 2 +- .../{ => chunk}/settings/SettingsHelper.java | 2 +- .../settings/StructureSettings.java | 2 +- .../{ => chunk}/settings/TerraSettings.java | 2 +- .../chunk/test/TestChunkGenerator.java | 25 ------------- .../terraforged/chunk/test/TestHeightMap.java | 4 +-- .../chunk/util/TerraContainer.java | 2 +- .../com/terraforged/command/TerraCommand.java | 2 +- .../com/terraforged/data/LangGenerator.java | 2 +- .../feature/context/ChanceContext.java | 2 +- .../decorator/poisson/BiomeVariance.java | 2 +- .../com/terraforged/gui/SettingsScreen.java | 4 +-- .../com/terraforged/gui/page/SimplePage.java | 2 +- .../gui/page/SimplePreviewPage.java | 2 +- .../terraforged/gui/page/UpdatablePage.java | 2 +- .../com/terraforged/gui/page/WorldPage.java | 2 +- .../com/terraforged/gui/preview/Preview.java | 36 +++++++++---------- .../terraforged/gui/preview/PreviewPage.java | 2 +- .../com/terraforged/gui/preview2/Preview.java | 6 ++-- .../terraforged/gui/preview2/PreviewPage.java | 2 +- 32 files changed, 82 insertions(+), 96 deletions(-) rename src/main/java/com/terraforged/{ => chunk}/settings/DimesionSettings.java (98%) rename src/main/java/com/terraforged/{ => chunk}/settings/Miscellaneous.java (98%) rename src/main/java/com/terraforged/{ => chunk}/settings/SettingsHelper.java (98%) rename src/main/java/com/terraforged/{ => chunk}/settings/StructureSettings.java (98%) rename src/main/java/com/terraforged/{ => chunk}/settings/TerraSettings.java (97%) diff --git a/Engine b/Engine index 4a9677c..74305c7 160000 --- a/Engine +++ b/Engine @@ -1 +1 @@ -Subproject commit 4a9677caf9d6805893747ce91ffb116ec9db64e6 +Subproject commit 74305c79ee507602f7721478fbd5029bb5a9a51b diff --git a/generated/resources/assets/terraforged/lang/en_us.json b/generated/resources/assets/terraforged/lang/en_us.json index 6ae4347..f23509e 100644 --- a/generated/resources/assets/terraforged/lang/en_us.json +++ b/generated/resources/assets/terraforged/lang/en_us.json @@ -172,6 +172,12 @@ "display.terraforged.world.properties.sea_level": "Sea Level", "display.terraforged.world.properties.spawn_type": "Spawn Type", "display.terraforged.world.properties.world_height": "World Height", + "display.terraforged.world.transition_points": "Transition Points", + "display.terraforged.world.transition_points.beach": "Beach", + "display.terraforged.world.transition_points.coast": "Coast", + "display.terraforged.world.transition_points.deep_ocean": "Deep Ocean", + "display.terraforged.world.transition_points.inland": "Inland", + "display.terraforged.world.transition_points.shallow_ocean": "Shallow Ocean", "generator.terraforged": "TerraForged", "generator.terratest": "TerraTest", "tooltip.terraforged.climate.biome_edge_shape.gain": "Controls the gain subsequent noise octaves", @@ -291,5 +297,10 @@ "tooltip.terraforged.world.continent.ocean_scale": "Controls the amount of ocean between continents", "tooltip.terraforged.world.properties.sea_level": "Controls the sea level", "tooltip.terraforged.world.properties.spawn_type": "Set whether spawn should be close to x=0,z=0 or the centre of the nearest continent", - "tooltip.terraforged.world.properties.world_height": "Controls the world height" + "tooltip.terraforged.world.properties.world_height": "Controls the world height", + "tooltip.terraforged.world.transition_points.beach": "The beach transition point", + "tooltip.terraforged.world.transition_points.coast": "The coast transition point", + "tooltip.terraforged.world.transition_points.deep_ocean": "The deep ocean transition point", + "tooltip.terraforged.world.transition_points.inland": "The inland transition point", + "tooltip.terraforged.world.transition_points.shallow_ocean": "The shallow ocean transition point" } \ No newline at end of file diff --git a/src/main/java/com/terraforged/TerraForgedMod.java b/src/main/java/com/terraforged/TerraForgedMod.java index 3c74eed..31262ea 100644 --- a/src/main/java/com/terraforged/TerraForgedMod.java +++ b/src/main/java/com/terraforged/TerraForgedMod.java @@ -34,7 +34,7 @@ import com.terraforged.feature.decorator.poisson.PoissonAtSurface; import com.terraforged.feature.feature.DiskFeature; import com.terraforged.feature.feature.FreezeLayer; import com.terraforged.fm.template.TemplateManager; -import com.terraforged.settings.SettingsHelper; +import com.terraforged.chunk.settings.SettingsHelper; import com.terraforged.util.DataPackFinder; import com.terraforged.util.Environment; import net.minecraft.world.biome.Biomes; diff --git a/src/main/java/com/terraforged/TerraWorld.java b/src/main/java/com/terraforged/TerraWorld.java index 98b4922..957bb00 100644 --- a/src/main/java/com/terraforged/TerraWorld.java +++ b/src/main/java/com/terraforged/TerraWorld.java @@ -32,9 +32,9 @@ import com.terraforged.chunk.TerraContext; import com.terraforged.chunk.TerraGenSettings; import com.terraforged.chunk.test.TestChunkGenerator; import com.terraforged.gui.SettingsScreen; -import com.terraforged.settings.DimesionSettings; -import com.terraforged.settings.SettingsHelper; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.DimesionSettings; +import com.terraforged.chunk.settings.SettingsHelper; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.Environment; import com.terraforged.util.nbt.NBTHelper; import com.terraforged.world.terrain.Terrains; diff --git a/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java b/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java index a3318e3..fc171c1 100644 --- a/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java +++ b/src/main/java/com/terraforged/chunk/TerraChunkGenerator.java @@ -38,10 +38,10 @@ import com.terraforged.chunk.generator.SurfaceGenerator; import com.terraforged.chunk.generator.TerrainCarver; import com.terraforged.chunk.generator.TerrainGenerator; import com.terraforged.core.cell.Cell; -import com.terraforged.core.region.Region; -import com.terraforged.core.region.Size; -import com.terraforged.core.region.chunk.ChunkReader; -import com.terraforged.core.region.gen.RegionCache; +import com.terraforged.core.tile.Tile; +import com.terraforged.core.tile.Size; +import com.terraforged.core.tile.chunk.ChunkReader; +import com.terraforged.core.tile.gen.TileCache; import com.terraforged.feature.BlockDataManager; import com.terraforged.fm.FeatureManager; import com.terraforged.fm.data.DataManager; @@ -86,7 +86,7 @@ public class TerraChunkGenerator extends ChunkGenerator { private final List baseDecorators; private final List postProcessors; - private final RegionCache regionCache; + private final TileCache tileCache; public TerraChunkGenerator(TerraContext context, TerraBiomeProvider biomeProvider, GenerationSettings settings) { super(context.world, biomeProvider, settings); @@ -105,7 +105,7 @@ public class TerraChunkGenerator extends ChunkGenerator { this.geologyManager = TerraSetupFactory.createGeologyManager(context); this.baseDecorators = TerraSetupFactory.createBaseDecorators(geologyManager, context); this.postProcessors = TerraSetupFactory.createFeatureDecorators(context); - this.regionCache = context.cache; + this.tileCache = context.cache; try (DataManager data = TerraSetupFactory.createDataManager()) { FeatureManager.initData(data); @@ -248,19 +248,19 @@ public class TerraChunkGenerator extends ChunkGenerator { } public final void queueChunk(int chunkX, int chunkZ) { - int rx = regionCache.chunkToRegion(chunkX); - int rz = regionCache.chunkToRegion(chunkZ); - regionCache.queueRegion(rx, rz); + int rx = tileCache.chunkToRegion(chunkX); + int rz = tileCache.chunkToRegion(chunkZ); + tileCache.queueRegion(rx, rz); } - public final Region getRegion(int chunkX, int chunkZ) { - int rx = regionCache.chunkToRegion(chunkX); - int rz = regionCache.chunkToRegion(chunkZ); - return regionCache.getRegion(rx, rz); + public final Tile getTile(int chunkX, int chunkZ) { + int rx = tileCache.chunkToRegion(chunkX); + int rz = tileCache.chunkToRegion(chunkZ); + return tileCache.getRegion(rx, rz); } public final ChunkReader getChunkReader(int chunkX, int chunkZ) { - return regionCache.getChunk(chunkX, chunkZ); + return tileCache.getChunk(chunkX, chunkZ); } public static ChunkReader getChunk(IWorld world, ChunkGenerator generator) { diff --git a/src/main/java/com/terraforged/chunk/TerraContext.java b/src/main/java/com/terraforged/chunk/TerraContext.java index 4081004..f6f4d42 100644 --- a/src/main/java/com/terraforged/chunk/TerraContext.java +++ b/src/main/java/com/terraforged/chunk/TerraContext.java @@ -31,10 +31,10 @@ import com.terraforged.api.chunk.surface.ChunkSurfaceBuffer; import com.terraforged.api.chunk.surface.SurfaceContext; import com.terraforged.config.PerfDefaults; import com.terraforged.core.concurrent.thread.ThreadPools; -import com.terraforged.core.region.gen.RegionCache; -import com.terraforged.core.region.gen.RegionGenerator; +import com.terraforged.core.tile.gen.TileCache; +import com.terraforged.core.tile.gen.TileGenerator; import com.terraforged.material.Materials; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.world.GeneratorContext; import com.terraforged.world.WorldGeneratorFactory; import com.terraforged.world.heightmap.Heightmap; @@ -74,13 +74,13 @@ public class TerraContext extends GeneratorContext { return new SurfaceContext(buffer, levels, terrain, factory.getClimate(), settings, world.getSeed()); } - public static RegionCache createCache(WorldGeneratorFactory factory) { + public static TileCache createCache(WorldGeneratorFactory factory) { CommentedConfig config = PerfDefaults.getAndPrintPerfSettings(); boolean batching = config.getOrElse("batching",false); int tileSize = Math.min(PerfDefaults.MAX_TILE_SIZE, Math.max(2, config.getInt("tile_size"))); int batchCount = Math.min(PerfDefaults.MAX_BATCH_COUNT, Math.max(1, config.getInt("batch_count"))); int threadCount = Math.min(PerfDefaults.MAX_THREAD_COUNT, Math.max(1, config.getInt("thread_count"))); - return RegionGenerator.builder() + return TileGenerator.builder() .pool(ThreadPools.create(threadCount, batching)) .size(tileSize, 2) .batch(batchCount) diff --git a/src/main/java/com/terraforged/chunk/TerraGenSettings.java b/src/main/java/com/terraforged/chunk/TerraGenSettings.java index ffa4f32..6ffe581 100644 --- a/src/main/java/com/terraforged/chunk/TerraGenSettings.java +++ b/src/main/java/com/terraforged/chunk/TerraGenSettings.java @@ -25,7 +25,7 @@ package com.terraforged.chunk; -import com.terraforged.settings.StructureSettings; +import com.terraforged.chunk.settings.StructureSettings; import net.minecraft.world.gen.OverworldGenSettings; public class TerraGenSettings extends OverworldGenSettings { diff --git a/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java b/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java index 7559997..9244a37 100644 --- a/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/BiomeGenerator.java @@ -3,7 +3,7 @@ package com.terraforged.chunk.generator; import com.terraforged.biome.provider.TerraBiomeProvider; import com.terraforged.chunk.TerraChunkGenerator; import com.terraforged.chunk.util.TerraContainer; -import com.terraforged.core.region.chunk.ChunkReader; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.world.terrain.decorator.Decorator; import net.minecraft.util.math.ChunkPos; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java b/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java index 1fbfe17..94b6139 100644 --- a/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/FeatureGenerator.java @@ -5,7 +5,7 @@ import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.chunk.TerraChunkGenerator; import com.terraforged.chunk.fix.RegionFix; import com.terraforged.chunk.util.TerraContainer; -import com.terraforged.core.region.chunk.ChunkReader; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.util.Environment; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; diff --git a/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java b/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java index c406cd3..8fe96ef 100644 --- a/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/SurfaceGenerator.java @@ -6,7 +6,7 @@ import com.terraforged.api.chunk.surface.SurfaceContext; import com.terraforged.chunk.TerraChunkGenerator; import com.terraforged.chunk.util.FastChunk; import com.terraforged.chunk.util.TerraContainer; -import com.terraforged.core.region.chunk.ChunkReader; +import com.terraforged.core.tile.chunk.ChunkReader; import net.minecraft.util.SharedSeedRandom; import net.minecraft.world.chunk.IChunk; import net.minecraft.world.gen.Heightmap; diff --git a/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java b/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java index 9662e0a..4e0cc52 100644 --- a/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java +++ b/src/main/java/com/terraforged/chunk/generator/TerrainGenerator.java @@ -5,7 +5,7 @@ import com.terraforged.chunk.TerraChunkGenerator; import com.terraforged.chunk.column.ChunkPopulator; import com.terraforged.chunk.util.FastChunk; import com.terraforged.chunk.util.TerraContainer; -import com.terraforged.core.region.chunk.ChunkReader; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.feature.TerrainHelper; import com.terraforged.world.climate.Climate; import com.terraforged.world.heightmap.Levels; diff --git a/src/main/java/com/terraforged/settings/DimesionSettings.java b/src/main/java/com/terraforged/chunk/settings/DimesionSettings.java similarity index 98% rename from src/main/java/com/terraforged/settings/DimesionSettings.java rename to src/main/java/com/terraforged/chunk/settings/DimesionSettings.java index 70ce4b2..37389f7 100644 --- a/src/main/java/com/terraforged/settings/DimesionSettings.java +++ b/src/main/java/com/terraforged/chunk/settings/DimesionSettings.java @@ -1,4 +1,4 @@ -package com.terraforged.settings; +package com.terraforged.chunk.settings; import com.terraforged.TerraWorld; import com.terraforged.core.serialization.annotation.Comment; diff --git a/src/main/java/com/terraforged/settings/Miscellaneous.java b/src/main/java/com/terraforged/chunk/settings/Miscellaneous.java similarity index 98% rename from src/main/java/com/terraforged/settings/Miscellaneous.java rename to src/main/java/com/terraforged/chunk/settings/Miscellaneous.java index 33b3593..12b4d6b 100644 --- a/src/main/java/com/terraforged/settings/Miscellaneous.java +++ b/src/main/java/com/terraforged/chunk/settings/Miscellaneous.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.settings; +package com.terraforged.chunk.settings; import com.terraforged.core.serialization.annotation.Comment; import com.terraforged.core.serialization.annotation.Serializable; diff --git a/src/main/java/com/terraforged/settings/SettingsHelper.java b/src/main/java/com/terraforged/chunk/settings/SettingsHelper.java similarity index 98% rename from src/main/java/com/terraforged/settings/SettingsHelper.java rename to src/main/java/com/terraforged/chunk/settings/SettingsHelper.java index 13239e1..891a10e 100644 --- a/src/main/java/com/terraforged/settings/SettingsHelper.java +++ b/src/main/java/com/terraforged/chunk/settings/SettingsHelper.java @@ -1,4 +1,4 @@ -package com.terraforged.settings; +package com.terraforged.chunk.settings; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/src/main/java/com/terraforged/settings/StructureSettings.java b/src/main/java/com/terraforged/chunk/settings/StructureSettings.java similarity index 98% rename from src/main/java/com/terraforged/settings/StructureSettings.java rename to src/main/java/com/terraforged/chunk/settings/StructureSettings.java index fbe599a..8e84f38 100644 --- a/src/main/java/com/terraforged/settings/StructureSettings.java +++ b/src/main/java/com/terraforged/chunk/settings/StructureSettings.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.settings; +package com.terraforged.chunk.settings; import com.terraforged.core.serialization.annotation.Comment; import com.terraforged.core.serialization.annotation.Range; diff --git a/src/main/java/com/terraforged/settings/TerraSettings.java b/src/main/java/com/terraforged/chunk/settings/TerraSettings.java similarity index 97% rename from src/main/java/com/terraforged/settings/TerraSettings.java rename to src/main/java/com/terraforged/chunk/settings/TerraSettings.java index ec08b65..7f487dc 100644 --- a/src/main/java/com/terraforged/settings/TerraSettings.java +++ b/src/main/java/com/terraforged/chunk/settings/TerraSettings.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package com.terraforged.settings; +package com.terraforged.chunk.settings; import com.terraforged.core.serialization.annotation.Serializable; import com.terraforged.core.settings.Settings; diff --git a/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java b/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java index ce8933e..70587b9 100644 --- a/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java +++ b/src/main/java/com/terraforged/chunk/test/TestChunkGenerator.java @@ -28,10 +28,6 @@ package com.terraforged.chunk.test; import com.terraforged.biome.provider.TerraBiomeProvider; 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 net.minecraft.world.gen.GenerationSettings; public class TestChunkGenerator extends TerraChunkGenerator { @@ -47,25 +43,4 @@ public class TestChunkGenerator extends TerraChunkGenerator { public TerraBiomeProvider getBiomeProvider() { return biomeProvider; } - - private static class TestHeightMap extends WorldHeightmap { - - private final Populator populator; - - public TestHeightMap(GeneratorContext context) { - super(context); - this.populator = getPopulator(Test.getTerrainType(context.terrain)); - } - - @Override - public void apply(Cell cell, float x, float y) { - super.apply(cell, x, y); - populator.apply(cell, x, y); - } - - @Override - public void tag(Cell cell, float x, float y) { - populator.tag(cell, x, y); - } - } } diff --git a/src/main/java/com/terraforged/chunk/test/TestHeightMap.java b/src/main/java/com/terraforged/chunk/test/TestHeightMap.java index 22ec06b..0fdb2d3 100644 --- a/src/main/java/com/terraforged/chunk/test/TestHeightMap.java +++ b/src/main/java/com/terraforged/chunk/test/TestHeightMap.java @@ -2,10 +2,10 @@ package com.terraforged.chunk.test; import com.terraforged.core.cell.Cell; import com.terraforged.world.GeneratorContext; -import com.terraforged.world.heightmap.WorldHeightmap; +import com.terraforged.world.heightmap.Heightmap; import com.terraforged.world.terrain.Terrains; -public class TestHeightMap extends WorldHeightmap { +public class TestHeightMap extends Heightmap { private final Terrains terrains; diff --git a/src/main/java/com/terraforged/chunk/util/TerraContainer.java b/src/main/java/com/terraforged/chunk/util/TerraContainer.java index 5edb79c..242ed09 100644 --- a/src/main/java/com/terraforged/chunk/util/TerraContainer.java +++ b/src/main/java/com/terraforged/chunk/util/TerraContainer.java @@ -3,7 +3,7 @@ package com.terraforged.chunk.util; import com.terraforged.api.biome.BiomeVariant; import com.terraforged.biome.provider.TerraBiomeProvider; import com.terraforged.core.cell.Cell; -import com.terraforged.core.region.chunk.ChunkReader; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.core.util.PosIterator; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.MathHelper; diff --git a/src/main/java/com/terraforged/command/TerraCommand.java b/src/main/java/com/terraforged/command/TerraCommand.java index 8fe4150..aeb419b 100644 --- a/src/main/java/com/terraforged/command/TerraCommand.java +++ b/src/main/java/com/terraforged/command/TerraCommand.java @@ -44,7 +44,7 @@ import com.terraforged.command.search.TerrainSearchTask; import com.terraforged.core.cell.Cell; import com.terraforged.core.concurrent.Resource; import com.terraforged.data.DataGen; -import com.terraforged.settings.SettingsHelper; +import com.terraforged.chunk.settings.SettingsHelper; import com.terraforged.world.WorldGenerator; import com.terraforged.world.terrain.Terrain; import com.terraforged.world.terrain.Terrains; diff --git a/src/main/java/com/terraforged/data/LangGenerator.java b/src/main/java/com/terraforged/data/LangGenerator.java index 6e922e8..99130de 100644 --- a/src/main/java/com/terraforged/data/LangGenerator.java +++ b/src/main/java/com/terraforged/data/LangGenerator.java @@ -2,7 +2,7 @@ package com.terraforged.data; import com.terraforged.core.util.NameUtil; import com.terraforged.gui.preview2.PreviewSettings; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.INBT; diff --git a/src/main/java/com/terraforged/feature/context/ChanceContext.java b/src/main/java/com/terraforged/feature/context/ChanceContext.java index 00aea2c..feae2a8 100644 --- a/src/main/java/com/terraforged/feature/context/ChanceContext.java +++ b/src/main/java/com/terraforged/feature/context/ChanceContext.java @@ -6,7 +6,7 @@ import com.terraforged.core.cell.Cell; import com.terraforged.core.concurrent.Resource; import com.terraforged.core.concurrent.cache.SafeCloseable; import com.terraforged.core.concurrent.pool.ObjectPool; -import com.terraforged.core.region.chunk.ChunkReader; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.world.heightmap.Levels; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; 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 6902329..cf3231b 100644 --- a/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java +++ b/src/main/java/com/terraforged/feature/decorator/poisson/BiomeVariance.java @@ -2,7 +2,7 @@ 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 com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.n2d.Module; import com.terraforged.n2d.Source; import com.terraforged.n2d.util.NoiseUtil; diff --git a/src/main/java/com/terraforged/gui/SettingsScreen.java b/src/main/java/com/terraforged/gui/SettingsScreen.java index ce0bfa9..01bb69c 100644 --- a/src/main/java/com/terraforged/gui/SettingsScreen.java +++ b/src/main/java/com/terraforged/gui/SettingsScreen.java @@ -32,8 +32,8 @@ import com.terraforged.gui.page.SimplePage; import com.terraforged.gui.page.SimplePreviewPage; import com.terraforged.gui.page.WorldPage; import com.terraforged.gui.preview2.PreviewPage; -import com.terraforged.settings.SettingsHelper; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.SettingsHelper; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.IGuiEventListener; diff --git a/src/main/java/com/terraforged/gui/page/SimplePage.java b/src/main/java/com/terraforged/gui/page/SimplePage.java index d5dcf0c..ea8f7d8 100644 --- a/src/main/java/com/terraforged/gui/page/SimplePage.java +++ b/src/main/java/com/terraforged/gui/page/SimplePage.java @@ -1,7 +1,7 @@ package com.terraforged.gui.page; import com.terraforged.gui.OverlayScreen; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.nbt.CompoundNBT; diff --git a/src/main/java/com/terraforged/gui/page/SimplePreviewPage.java b/src/main/java/com/terraforged/gui/page/SimplePreviewPage.java index 2806d0f..c7b0bb0 100644 --- a/src/main/java/com/terraforged/gui/page/SimplePreviewPage.java +++ b/src/main/java/com/terraforged/gui/page/SimplePreviewPage.java @@ -1,6 +1,6 @@ package com.terraforged.gui.page; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; import java.util.function.Function; diff --git a/src/main/java/com/terraforged/gui/page/UpdatablePage.java b/src/main/java/com/terraforged/gui/page/UpdatablePage.java index 5ad636a..6b02abd 100644 --- a/src/main/java/com/terraforged/gui/page/UpdatablePage.java +++ b/src/main/java/com/terraforged/gui/page/UpdatablePage.java @@ -1,7 +1,7 @@ package com.terraforged.gui.page; import com.terraforged.gui.OverlayScreen; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import java.util.function.Consumer; diff --git a/src/main/java/com/terraforged/gui/page/WorldPage.java b/src/main/java/com/terraforged/gui/page/WorldPage.java index 05ef40d..7f1fd81 100644 --- a/src/main/java/com/terraforged/gui/page/WorldPage.java +++ b/src/main/java/com/terraforged/gui/page/WorldPage.java @@ -28,7 +28,7 @@ package com.terraforged.gui.page; import com.terraforged.TerraWorld; import com.terraforged.gui.OverlayScreen; import com.terraforged.gui.element.TerraTextInput; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.client.gui.widget.Widget; 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 45447ab..9a24c78 100644 --- a/src/main/java/com/terraforged/gui/preview/Preview.java +++ b/src/main/java/com/terraforged/gui/preview/Preview.java @@ -30,9 +30,9 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.terraforged.core.cell.Cell; import com.terraforged.core.concurrent.cache.CacheEntry; import com.terraforged.core.concurrent.thread.ThreadPools; -import com.terraforged.core.region.Region; -import com.terraforged.core.region.Size; -import com.terraforged.core.region.gen.RegionGenerator; +import com.terraforged.core.tile.Tile; +import com.terraforged.core.tile.Size; +import com.terraforged.core.tile.gen.TileGenerator; import com.terraforged.core.settings.Settings; import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.util.nbt.NBTHelper; @@ -68,8 +68,8 @@ public class Preview extends Button { private int seed; private long lastUpdate = 0L; private Settings settings = new Settings(); - private CacheEntry task = null; - private Region region = null; + private CacheEntry task = null; + private Tile tile = null; private String[] labels = {"Area: ", "Terrain: ", "Biome: "}; private String[] values = {"", "", ""}; @@ -130,8 +130,8 @@ public class Preview extends Button { private void preRender() { if (task != null && task.isDone()) { try { - region = task.get(); - render(region); + tile = task.get(); + render(tile); } catch (Throwable t) { t.printStackTrace(); } finally { @@ -140,7 +140,7 @@ public class Preview extends Button { } } - private void render(Region region) { + private void render(Tile tile) { NativeImage image = texture.getTextureData(); if (image == null) { return; @@ -150,7 +150,7 @@ public class Preview extends Button { Levels levels = new Levels(settings.world); int stroke = 2; - int width = region.getBlockSize().size; + int width = tile.getBlockSize().size; int zoom = (101 - previewSettings.zoom); int half = width / 2; @@ -163,7 +163,7 @@ public class Preview extends Button { float waterLevelModifier = settings.world.properties.seaLevel / (float) settings.world.properties.worldHeight; float imageWaterLevelY = image.getHeight() - 1 - (waterLevelModifier * SLICE_HEIGHT * unit); - region.iterate((cell, x, z) -> { + tile.iterate((cell, x, z) -> { if (x < stroke || z < stroke || x >= width - stroke || z >= width - stroke) { image.setPixelRGBA(x, z, Color.BLACK.getRGB()); } else { @@ -192,7 +192,7 @@ public class Preview extends Button { texture.updateDynamicTexture(); } - private CacheEntry generate(Settings settings, CompoundNBT prevSettings) { + private CacheEntry generate(Settings settings, CompoundNBT prevSettings) { NBTHelper.deserialize(prevSettings, previewSettings); settings.world.seed = seed; this.settings = settings; @@ -202,7 +202,7 @@ public class Preview extends Button { MutableVeci center = new MutableVeci(); context.factory.getHeightmap().getContinent().getNearestCenter(offsetX, offsetZ, center); - RegionGenerator renderer = RegionGenerator.builder() + TileGenerator renderer = TileGenerator.builder() .pool(ThreadPools.getPool()) .size(FACTOR, 0) .factory(context.factory) @@ -215,20 +215,20 @@ public class Preview extends Button { } private void updateLegend(int mx ,int my) { - if (region != null) { + if (tile != null) { int left = this.x; int top = this.y; float size = this.width; int zoom = (101 - previewSettings.zoom); - int width = Math.max(1, region.getBlockSize().size * zoom); - int height = Math.max(1, region.getBlockSize().size * zoom); + int width = Math.max(1, tile.getBlockSize().size * zoom); + int height = Math.max(1, tile.getBlockSize().size * zoom); values[0] = width + "x" + height; if (mx >= left && mx <= left + size && my >= top && my <= top + size) { float fx = (mx - left) / size; float fz = (my - top) / size; - int ix = NoiseUtil.round(fx * region.getBlockSize().size); - int iz = NoiseUtil.round(fz * region.getBlockSize().size); - Cell cell = region.getCell(ix, iz); + int ix = NoiseUtil.round(fx * tile.getBlockSize().size); + int iz = NoiseUtil.round(fz * tile.getBlockSize().size); + Cell cell = tile.getCell(ix, iz); values[1] = getTerrainName(cell); values[2] = getBiomeName(cell); } diff --git a/src/main/java/com/terraforged/gui/preview/PreviewPage.java b/src/main/java/com/terraforged/gui/preview/PreviewPage.java index da69680..31276aa 100644 --- a/src/main/java/com/terraforged/gui/preview/PreviewPage.java +++ b/src/main/java/com/terraforged/gui/preview/PreviewPage.java @@ -28,7 +28,7 @@ package com.terraforged.gui.preview; import com.terraforged.gui.OverlayScreen; import com.terraforged.gui.element.TerraButton; import com.terraforged.gui.page.UpdatablePage; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.nbt.CompoundNBT; diff --git a/src/main/java/com/terraforged/gui/preview2/Preview.java b/src/main/java/com/terraforged/gui/preview2/Preview.java index adef333..0c99623 100644 --- a/src/main/java/com/terraforged/gui/preview2/Preview.java +++ b/src/main/java/com/terraforged/gui/preview2/Preview.java @@ -3,11 +3,11 @@ package com.terraforged.gui.preview2; import com.mojang.blaze3d.systems.RenderSystem; import com.terraforged.core.concurrent.thread.ThreadPool; import com.terraforged.core.concurrent.thread.ThreadPools; -import com.terraforged.core.region.gen.RegionGenerator; +import com.terraforged.core.tile.gen.TileGenerator; import com.terraforged.core.render.RenderAPI; import com.terraforged.core.render.RenderSettings; import com.terraforged.core.render.RenderWorld; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.world.GeneratorContext; import com.terraforged.world.continent.MutableVeci; import com.terraforged.world.continent.SpawnType; @@ -100,7 +100,7 @@ public class Preview extends Widget { offsetX = center.x; offsetZ = center.z; - RegionGenerator generator = RegionGenerator.builder() + TileGenerator generator = TileGenerator.builder() .pool(threadPool) .size(size, 0) .factory(context.factory) diff --git a/src/main/java/com/terraforged/gui/preview2/PreviewPage.java b/src/main/java/com/terraforged/gui/preview2/PreviewPage.java index a195f3a..7f2bcc0 100644 --- a/src/main/java/com/terraforged/gui/preview2/PreviewPage.java +++ b/src/main/java/com/terraforged/gui/preview2/PreviewPage.java @@ -3,7 +3,7 @@ package com.terraforged.gui.preview2; import com.terraforged.gui.OverlayScreen; import com.terraforged.gui.element.TerraButton; import com.terraforged.gui.page.UpdatablePage; -import com.terraforged.settings.TerraSettings; +import com.terraforged.chunk.settings.TerraSettings; import com.terraforged.util.nbt.NBTHelper; import net.minecraft.nbt.CompoundNBT;