From 6fc16103f1820c534815265c598ecdfed39f07d8 Mon Sep 17 00:00:00 2001 From: dags- Date: Sun, 28 Jun 2020 14:53:35 +0100 Subject: [PATCH] - fix structure settings not saving to worldinfo - optionally ignore erosion/smoothing while allowing steepness/beach detection - add transition point render mode for map - revert transition points to defaults if user has mis-configured them in a breaking way - allow biome modification on river banks --- Engine | 2 +- .../assets/terraforged/lang/en_us.json | 253 +----------------- gradle.properties | 2 +- .../terraforged/api/biome/BiomeVariant.java | 4 +- .../com/terraforged/api/event/SetupEvent.java | 2 +- .../mod/biome/map/SimpleBiomeMap.java | 2 +- .../mod/biome/map/set/BiomeSet.java | 4 +- .../mod/biome/map/set/BiomeTypeSet.java | 2 +- .../mod/biome/map/set/RiverSet.java | 2 +- .../mod/biome/map/set/TemperatureSet.java | 2 +- .../mod/biome/modifier/BeachModifier.java | 2 +- .../biome/modifier/BiomeModifierManager.java | 8 +- .../mod/biome/modifier/CoastModifier.java | 2 +- .../biome/modifier/DesertColorModifier.java | 2 +- .../mod/biome/modifier/MountainModifier.java | 2 +- .../mod/biome/provider/BiomeWeights.java | 20 +- .../biome/provider/TerraBiomeProvider.java | 6 +- .../mod/biome/spawn/SpawnSearch.java | 2 +- .../mod/biome/surface/DunesSurface.java | 2 +- .../mod/biome/surface/IcebergsSurface.java | 2 +- .../mod/biome/tag/BiomeTagManager.java | 2 +- .../mod/chunk/TerraChunkGenerator.java | 20 +- .../terraforged/mod/chunk/TerraContext.java | 6 +- .../mod/chunk/TerraSetupFactory.java | 34 +-- .../mod/chunk/column/CoastDecorator.java | 2 +- .../mod/chunk/column/GeologyDecorator.java | 2 +- .../mod/chunk/generator/BiomeGenerator.java | 2 +- .../mod/chunk/generator/FeatureGenerator.java | 2 +- .../chunk/generator/StructureGenerator.java | 2 +- .../mod/chunk/generator/SurfaceGenerator.java | 4 +- .../mod/chunk/generator/TerrainCarver.java | 2 +- .../mod/chunk/generator/TerrainGenerator.java | 2 +- .../mod/chunk/settings/DimesionSettings.java | 2 +- .../mod/chunk/settings/Miscellaneous.java | 2 +- .../mod/chunk/settings/StructureSettings.java | 4 +- .../mod/chunk/test/TestBiomeProvider.java | 2 +- .../mod/chunk/test/TestHeightMap.java | 1 - .../mod/client/gui/SettingsScreen.java | 2 +- .../mod/client/gui/element/TerraToggle.java | 15 +- .../mod/client/gui/preview/Preview.java | 8 +- .../mod/client/gui/preview/PreviewPage.java | 1 + .../client/gui/preview/PreviewSettings.java | 2 + .../mod/client/gui/preview/RenderMode.java | 26 +- .../mod/client/gui/preview2/Preview.java | 2 +- .../client/gui/preview2/PreviewSettings.java | 2 + .../terraforged/mod/config/PerfDefaults.java | 2 +- .../com/terraforged/mod/data/DataGen.java | 1 + .../terraforged/mod/data/LangGenerator.java | 2 +- .../terraforged/mod/data/WorldGenBiomes.java | 27 ++ .../mod/feature/BlockDataManager.java | 2 +- .../com/terraforged/mod/feature/Matchers.java | 2 +- .../mod/feature/context/ChanceContext.java | 4 +- .../decorator/poisson/BiomeVariance.java | 2 +- .../mod/feature/sapling/SaplingConfig.java | 2 +- .../mod/feature/sapling/SaplingListener.java | 6 +- .../mod/material/geology/GeoManager.java | 2 +- .../mod/server/command/TerraCommand.java | 6 +- .../command/search/BiomeSearchTask.java | 2 +- .../mod/util/setup/SetupDebug.java | 2 +- .../mod/util/setup/SetupHooks.java | 2 +- 60 files changed, 196 insertions(+), 340 deletions(-) diff --git a/Engine b/Engine index e151e3c..ad79d9c 160000 --- a/Engine +++ b/Engine @@ -1 +1 @@ -Subproject commit e151e3ccf02d305378c269e3086863069fdf4a12 +Subproject commit ad79d9cb059d512a955e99bdd9a4340e07ae34e8 diff --git a/generated/resources/assets/terraforged/lang/en_us.json b/generated/resources/assets/terraforged/lang/en_us.json index dc49c69..cec6033 100644 --- a/generated/resources/assets/terraforged/lang/en_us.json +++ b/generated/resources/assets/terraforged/lang/en_us.json @@ -14,31 +14,6 @@ "biome.terraforged.stone_forest": "Stone Forest", "biome.terraforged.taiga_scrub": "Taiga Scrub", "biome.terraforged.warm_beach": "Warm Beach", - "display.terraforged.climate": "Climate", - "display.terraforged.climate.biome_edge_shape": "Biome Edge Shape", - "display.terraforged.climate.biome_edge_shape.gain": "Gain", - "display.terraforged.climate.biome_edge_shape.lacunarity": "Lacunarity", - "display.terraforged.climate.biome_edge_shape.octaves": "Octaves", - "display.terraforged.climate.biome_edge_shape.scale": "Scale", - "display.terraforged.climate.biome_edge_shape.strength": "Strength", - "display.terraforged.climate.biome_edge_shape.type": "Type", - "display.terraforged.climate.biome_shape": "Biome Shape", - "display.terraforged.climate.biome_shape.biome_size": "Biome Size", - "display.terraforged.climate.biome_shape.biome_warp_scale": "Biome Warp Scale", - "display.terraforged.climate.biome_shape.biome_warp_strength": "Biome Warp Strength", - "display.terraforged.climate.biome_shape.macro_noise_size": "Macro Noise Size", - "display.terraforged.climate.moisture": "Moisture", - "display.terraforged.climate.moisture.bias": "Bias", - "display.terraforged.climate.moisture.falloff": "Falloff", - "display.terraforged.climate.moisture.max": "Max", - "display.terraforged.climate.moisture.min": "Min", - "display.terraforged.climate.moisture.scale": "Scale", - "display.terraforged.climate.temperature": "Temperature", - "display.terraforged.climate.temperature.bias": "Bias", - "display.terraforged.climate.temperature.falloff": "Falloff", - "display.terraforged.climate.temperature.max": "Max", - "display.terraforged.climate.temperature.min": "Min", - "display.terraforged.climate.temperature.scale": "Scale", "display.terraforged.climate.title": "Climate Settings", "display.terraforged.dimensions": "Dimensions", "display.terraforged.dimensions.bedrock_layer": "Bedrock Layer", @@ -48,18 +23,6 @@ "display.terraforged.dimensions.dimensions": "Dimensions", "display.terraforged.dimensions.dimensions.end": "End", "display.terraforged.dimensions.dimensions.nether": "Nether", - "display.terraforged.filters": "Filters", - "display.terraforged.filters.erosion": "Erosion", - "display.terraforged.filters.erosion.deposite_rate": "Deposite Rate", - "display.terraforged.filters.erosion.droplet_lifetime": "Droplet Lifetime", - "display.terraforged.filters.erosion.droplet_velocity": "Droplet Velocity", - "display.terraforged.filters.erosion.droplet_volume": "Droplet Volume", - "display.terraforged.filters.erosion.erosion_rate": "Erosion Rate", - "display.terraforged.filters.erosion.iterations": "Iterations", - "display.terraforged.filters.smoothing": "Smoothing", - "display.terraforged.filters.smoothing.iterations": "Iterations", - "display.terraforged.filters.smoothing.smoothing_radius": "Smoothing Radius", - "display.terraforged.filters.smoothing.smoothing_rate": "Smoothing Rate", "display.terraforged.filters.title": "Filter Settings", "display.terraforged.general.cancel": "Cancel", "display.terraforged.general.done": "Done", @@ -87,29 +50,6 @@ "display.terraforged.preview.terrain": "Terrain: ", "display.terraforged.preview.zoom": "Zoom", "display.terraforged.river.title": "River Settings", - "display.terraforged.rivers": "Rivers", - "display.terraforged.rivers.primary_rivers": "Primary Rivers", - "display.terraforged.rivers.primary_rivers.bank_width": "Bank Width", - "display.terraforged.rivers.primary_rivers.bed_depth": "Bed Depth", - "display.terraforged.rivers.primary_rivers.bed_width": "Bed Width", - "display.terraforged.rivers.primary_rivers.fade": "Fade", - "display.terraforged.rivers.primary_rivers.max_bank_height": "Max Bank Height", - "display.terraforged.rivers.primary_rivers.min_bank_height": "Min Bank Height", - "display.terraforged.rivers.river_count": "River Count", - "display.terraforged.rivers.secondary_river": "Secondary River", - "display.terraforged.rivers.secondary_river.bank_width": "Bank Width", - "display.terraforged.rivers.secondary_river.bed_depth": "Bed Depth", - "display.terraforged.rivers.secondary_river.bed_width": "Bed Width", - "display.terraforged.rivers.secondary_river.fade": "Fade", - "display.terraforged.rivers.secondary_river.max_bank_height": "Max Bank Height", - "display.terraforged.rivers.secondary_river.min_bank_height": "Min Bank Height", - "display.terraforged.rivers.tertiary_rivers": "Tertiary Rivers", - "display.terraforged.rivers.tertiary_rivers.bank_width": "Bank Width", - "display.terraforged.rivers.tertiary_rivers.bed_depth": "Bed Depth", - "display.terraforged.rivers.tertiary_rivers.bed_width": "Bed Width", - "display.terraforged.rivers.tertiary_rivers.fade": "Fade", - "display.terraforged.rivers.tertiary_rivers.max_bank_height": "Max Bank Height", - "display.terraforged.rivers.tertiary_rivers.min_bank_height": "Min Bank Height", "display.terraforged.structures": "Structures", "display.terraforged.structures.mansions": "Mansions", "display.terraforged.structures.mansions.distance": "Distance", @@ -133,110 +73,15 @@ "display.terraforged.structures.villages": "Villages", "display.terraforged.structures.villages.distance": "Distance", "display.terraforged.structures.villages.separation": "Separation", - "display.terraforged.terrain": "Terrain", - "display.terraforged.terrain.badlands": "Badlands", - "display.terraforged.terrain.badlands.base_scale": "Base Scale", - "display.terraforged.terrain.badlands.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.badlands.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.badlands.weight": "Weight", - "display.terraforged.terrain.dales": "Dales", - "display.terraforged.terrain.dales.base_scale": "Base Scale", - "display.terraforged.terrain.dales.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.dales.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.dales.weight": "Weight", - "display.terraforged.terrain.general": "General", - "display.terraforged.terrain.general.global_horizontal_scale": "Global Horizontal Scale", - "display.terraforged.terrain.general.global_vertical_scale": "Global Vertical Scale", - "display.terraforged.terrain.general.terrain_region_size": "Terrain Region Size", - "display.terraforged.terrain.hills": "Hills", - "display.terraforged.terrain.hills.base_scale": "Base Scale", - "display.terraforged.terrain.hills.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.hills.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.hills.weight": "Weight", - "display.terraforged.terrain.mountains": "Mountains", - "display.terraforged.terrain.mountains.base_scale": "Base Scale", - "display.terraforged.terrain.mountains.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.mountains.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.mountains.weight": "Weight", - "display.terraforged.terrain.plains": "Plains", - "display.terraforged.terrain.plains.base_scale": "Base Scale", - "display.terraforged.terrain.plains.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.plains.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.plains.weight": "Weight", - "display.terraforged.terrain.plateau": "Plateau", - "display.terraforged.terrain.plateau.base_scale": "Base Scale", - "display.terraforged.terrain.plateau.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.plateau.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.plateau.weight": "Weight", - "display.terraforged.terrain.steppe": "Steppe", - "display.terraforged.terrain.steppe.base_scale": "Base Scale", - "display.terraforged.terrain.steppe.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.steppe.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.steppe.weight": "Weight", "display.terraforged.terrain.title": "Terrain Settings", - "display.terraforged.terrain.torridonian": "Torridonian", - "display.terraforged.terrain.torridonian.base_scale": "Base Scale", - "display.terraforged.terrain.torridonian.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.torridonian.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.torridonian.weight": "Weight", - "display.terraforged.terrain.volcano": "Volcano", - "display.terraforged.terrain.volcano.base_scale": "Base Scale", - "display.terraforged.terrain.volcano.horizontal_scale": "Horizontal Scale", - "display.terraforged.terrain.volcano.vertical_scale": "Vertical Scale", - "display.terraforged.terrain.volcano.weight": "Weight", - "display.terraforged.world": "World", - "display.terraforged.world.continent": "Continent", - "display.terraforged.world.continent.continent_mode": "Continent Mode", - "display.terraforged.world.continent.continent_scale": "Continent Scale", - "display.terraforged.world.continent.continent_shape": "Continent Shape", - "display.terraforged.world.continent.ocean_scale": "Ocean Scale", - "display.terraforged.world.properties": "Properties", - "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.title": "World Settings", - "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", - "tooltip.terraforged.climate.biome_edge_shape.lacunarity": "Controls the lacunarity of subsequent noise octaves", - "tooltip.terraforged.climate.biome_edge_shape.octaves": "Controls the number of noise octaves", - "tooltip.terraforged.climate.biome_edge_shape.scale": "Controls the scale of the noise", - "tooltip.terraforged.climate.biome_edge_shape.strength": "Controls the strength of the noise", - "tooltip.terraforged.climate.biome_edge_shape.type": "The noise type", - "tooltip.terraforged.climate.biome_shape.biome_size": "Controls the size of individual biomes", - "tooltip.terraforged.climate.biome_shape.biome_warp_scale": "Controls the scale of shape distortion for biomes", - "tooltip.terraforged.climate.biome_shape.biome_warp_strength": "Controls the strength of shape distortion for biomes", - "tooltip.terraforged.climate.biome_shape.macro_noise_size": "Macro noise is used to group large areas of biomes into a single type (such as deserts)", - "tooltip.terraforged.climate.moisture.bias": "The bias towards either end of the range", - "tooltip.terraforged.climate.moisture.falloff": "How quickly values transition from an extremity", - "tooltip.terraforged.climate.moisture.max": "The upper limit of the range", - "tooltip.terraforged.climate.moisture.min": "The lower limit of the range", - "tooltip.terraforged.climate.moisture.scale": "The horizontal scale", - "tooltip.terraforged.climate.temperature.bias": "The bias towards either end of the range", - "tooltip.terraforged.climate.temperature.falloff": "How quickly values transition from an extremity", - "tooltip.terraforged.climate.temperature.max": "The upper limit of the range", - "tooltip.terraforged.climate.temperature.min": "The lower limit of the range", - "tooltip.terraforged.climate.temperature.scale": "The horizontal scale", "tooltip.terraforged.dimensions.bedrock_layer.material": "Controls the material that should be used in the world's base layer", "tooltip.terraforged.dimensions.bedrock_layer.min_depth": "Controls the minimum height of the world's base layer", "tooltip.terraforged.dimensions.bedrock_layer.variance": "Controls the amount of height randomness of the world's base layer", "tooltip.terraforged.dimensions.dimensions.end": "Select the end generator", "tooltip.terraforged.dimensions.dimensions.nether": "Select the nether generator", - "tooltip.terraforged.filters.erosion.deposite_rate": "Controls how quickly material is deposited (during erosion)", - "tooltip.terraforged.filters.erosion.droplet_lifetime": "Controls the number of iterations that a single water droplet is simulated for", - "tooltip.terraforged.filters.erosion.droplet_velocity": "Controls the starting velocity of the simulated water droplet", - "tooltip.terraforged.filters.erosion.droplet_volume": "Controls the starting volume of water that a simulated water droplet carries", - "tooltip.terraforged.filters.erosion.erosion_rate": "Controls how quickly material dissolves (during erosion)", - "tooltip.terraforged.filters.erosion.iterations": "Controls the number of erosion iterations", - "tooltip.terraforged.filters.smoothing.iterations": "Controls the number of smoothing iterations", - "tooltip.terraforged.filters.smoothing.smoothing_radius": "Controls the smoothing radius", - "tooltip.terraforged.filters.smoothing.smoothing_rate": "Controls how strongly smoothing is applied", "tooltip.terraforged.miscellaneous.custom_biome_features": "Use custom biome features in place of vanilla ones (such as trees)", "tooltip.terraforged.miscellaneous.erosion_decorator": "Replace surface materials where erosion has occurred", "tooltip.terraforged.miscellaneous.mountain_biome_usage": "The probability that mountainous terrain will be set to a mountain biome type.\nThis may help improve compatibility with mods that rely exclusively on mountain biomes.", @@ -244,88 +89,18 @@ "tooltip.terraforged.miscellaneous.smooth_layer_decorator": "Modifies layer block levels (ie snow) to fit the terrain", "tooltip.terraforged.miscellaneous.strata_decorator": "Generates strata (rock layers) instead of just stone", "tooltip.terraforged.miscellaneous.vanilla_water_features": "Controls whether vanilla lakes & springs should generate", - "tooltip.terraforged.rivers.primary_rivers.bank_width": "Controls the river-banks width", - "tooltip.terraforged.rivers.primary_rivers.bed_depth": "Controls the depth of the river", - "tooltip.terraforged.rivers.primary_rivers.bed_width": "Controls the river-bed width", - "tooltip.terraforged.rivers.primary_rivers.fade": "Controls how much rivers taper", - "tooltip.terraforged.rivers.primary_rivers.max_bank_height": "Controls the height of river banks", - "tooltip.terraforged.rivers.primary_rivers.min_bank_height": "Controls the height of river banks", - "tooltip.terraforged.rivers.river_count": "Controls the number of major rivers per continent", - "tooltip.terraforged.rivers.secondary_river.bank_width": "Controls the river-banks width", - "tooltip.terraforged.rivers.secondary_river.bed_depth": "Controls the depth of the river", - "tooltip.terraforged.rivers.secondary_river.bed_width": "Controls the river-bed width", - "tooltip.terraforged.rivers.secondary_river.fade": "Controls how much rivers taper", - "tooltip.terraforged.rivers.secondary_river.max_bank_height": "Controls the height of river banks", - "tooltip.terraforged.rivers.secondary_river.min_bank_height": "Controls the height of river banks", - "tooltip.terraforged.rivers.tertiary_rivers.bank_width": "Controls the river-banks width", - "tooltip.terraforged.rivers.tertiary_rivers.bed_depth": "Controls the depth of the river", - "tooltip.terraforged.rivers.tertiary_rivers.bed_width": "Controls the river-bed width", - "tooltip.terraforged.rivers.tertiary_rivers.fade": "Controls how much rivers taper", - "tooltip.terraforged.rivers.tertiary_rivers.max_bank_height": "Controls the height of river banks", - "tooltip.terraforged.rivers.tertiary_rivers.min_bank_height": "Controls the height of river banks", - "tooltip.terraforged.structures.mansions.distance": "The distance (in chunks) between placements of this feature", - "tooltip.terraforged.structures.mansions.separation": "The separation (in chunks) between placements of this feature", - "tooltip.terraforged.structures.ocean_monuments.distance": "The distance (in chunks) between placements of this feature", - "tooltip.terraforged.structures.ocean_monuments.separation": "The separation (in chunks) between placements of this feature", - "tooltip.terraforged.structures.ocean_ruins.distance": "The distance (in chunks) between placements of this feature", - "tooltip.terraforged.structures.ocean_ruins.separation": "The separation (in chunks) between placements of this feature", - "tooltip.terraforged.structures.other_structures.distance": "The distance (in chunks) between placements of this feature", - "tooltip.terraforged.structures.other_structures.separation": "The separation (in chunks) between placements of this feature", - "tooltip.terraforged.structures.shipwrecks.distance": "The distance (in chunks) between placements of this feature", - "tooltip.terraforged.structures.shipwrecks.separation": "The separation (in chunks) between placements of this feature", - "tooltip.terraforged.structures.strongholds.distance": "The distance (in chunks) between placements of this feature", - "tooltip.terraforged.structures.strongholds.separation": "The separation (in chunks) between placements of this feature", - "tooltip.terraforged.structures.villages.distance": "The distance (in chunks) between placements of this feature", - "tooltip.terraforged.structures.villages.separation": "The separation (in chunks) between placements of this feature", - "tooltip.terraforged.terrain.badlands.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.badlands.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.badlands.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.badlands.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.dales.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.dales.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.dales.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.dales.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.general.global_horizontal_scale": "Globally controls the horizontal scaling of terrain", - "tooltip.terraforged.terrain.general.global_vertical_scale": "Globally controls the vertical scaling of terrain", - "tooltip.terraforged.terrain.general.terrain_region_size": "Controls the size of terrain regions", - "tooltip.terraforged.terrain.hills.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.hills.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.hills.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.hills.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.mountains.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.mountains.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.mountains.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.mountains.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.plains.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.plains.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.plains.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.plains.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.plateau.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.plateau.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.plateau.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.plateau.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.steppe.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.steppe.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.steppe.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.steppe.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.torridonian.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.torridonian.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.torridonian.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.torridonian.weight": "Controls how common this terrain type is", - "tooltip.terraforged.terrain.volcano.base_scale": "Controls the base height of this terrain", - "tooltip.terraforged.terrain.volcano.horizontal_scale": "Stretches or compresses the terrain horizontally", - "tooltip.terraforged.terrain.volcano.vertical_scale": "Stretches or compresses the terrain vertically", - "tooltip.terraforged.terrain.volcano.weight": "Controls how common this terrain type is", - "tooltip.terraforged.world.continent.continent_mode": "Controls the continent generator type", - "tooltip.terraforged.world.continent.continent_scale": "Controls the size of continents", - "tooltip.terraforged.world.continent.continent_shape": "Controls how continent shapes are calculated", - "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.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" + "tooltip.terraforged.structures.mansions.distance": "The maximum distance in chunks between attempts to spawn a structure", + "tooltip.terraforged.structures.mansions.separation": "The minimum distance in chunks between structure spawns", + "tooltip.terraforged.structures.ocean_monuments.distance": "The maximum distance in chunks between attempts to spawn a structure", + "tooltip.terraforged.structures.ocean_monuments.separation": "The minimum distance in chunks between structure spawns", + "tooltip.terraforged.structures.ocean_ruins.distance": "The maximum distance in chunks between attempts to spawn a structure", + "tooltip.terraforged.structures.ocean_ruins.separation": "The minimum distance in chunks between structure spawns", + "tooltip.terraforged.structures.other_structures.distance": "The maximum distance in chunks between attempts to spawn a structure", + "tooltip.terraforged.structures.other_structures.separation": "The minimum distance in chunks between structure spawns", + "tooltip.terraforged.structures.shipwrecks.distance": "The maximum distance in chunks between attempts to spawn a structure", + "tooltip.terraforged.structures.shipwrecks.separation": "The minimum distance in chunks between structure spawns", + "tooltip.terraforged.structures.strongholds.distance": "The maximum distance in chunks between attempts to spawn a structure", + "tooltip.terraforged.structures.strongholds.separation": "The minimum distance in chunks between structure spawns", + "tooltip.terraforged.structures.villages.distance": "The maximum distance in chunks between attempts to spawn a structure", + "tooltip.terraforged.structures.villages.separation": "The minimum distance in chunks between structure spawns" } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a89c5aa..689a2f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version=0.1.0-BETA-2 +mod_version=0.1.0-BETA-3 mc_version=1.15.2 forge_version=31.2.27 mcp_channel=snapshot diff --git a/src/main/java/com/terraforged/api/biome/BiomeVariant.java b/src/main/java/com/terraforged/api/biome/BiomeVariant.java index d6a90ee..f51a395 100644 --- a/src/main/java/com/terraforged/api/biome/BiomeVariant.java +++ b/src/main/java/com/terraforged/api/biome/BiomeVariant.java @@ -35,9 +35,7 @@ public abstract class BiomeVariant extends Biome { } // override to register a custom biome weight with Forge's BiomeManager (default is 10) - public void registerWeights() { - - } + public void registerWeights() {} @Override public int getGrassColor(double x, double z) { diff --git a/src/main/java/com/terraforged/api/event/SetupEvent.java b/src/main/java/com/terraforged/api/event/SetupEvent.java index f9333e8..eca100e 100644 --- a/src/main/java/com/terraforged/api/event/SetupEvent.java +++ b/src/main/java/com/terraforged/api/event/SetupEvent.java @@ -26,8 +26,8 @@ package com.terraforged.api.event; import com.terraforged.api.biome.modifier.ModifierManager; -import com.terraforged.api.chunk.column.DecoratorManager; import com.terraforged.api.biome.surface.SurfaceManager; +import com.terraforged.api.chunk.column.DecoratorManager; import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.layer.LayerManager; import com.terraforged.fm.modifier.FeatureModifiers; diff --git a/src/main/java/com/terraforged/mod/biome/map/SimpleBiomeMap.java b/src/main/java/com/terraforged/mod/biome/map/SimpleBiomeMap.java index 974d2f1..dff6c7d 100644 --- a/src/main/java/com/terraforged/mod/biome/map/SimpleBiomeMap.java +++ b/src/main/java/com/terraforged/mod/biome/map/SimpleBiomeMap.java @@ -2,12 +2,12 @@ package com.terraforged.mod.biome.map; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.map.defaults.DefaultBiomes; import com.terraforged.mod.biome.map.set.BiomeSet; import com.terraforged.mod.biome.map.set.BiomeTypeSet; import com.terraforged.mod.biome.map.set.RiverSet; import com.terraforged.mod.biome.map.set.TemperatureSet; -import com.terraforged.core.cell.Cell; import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.world.biome.BiomeType; import com.terraforged.world.heightmap.Levels; diff --git a/src/main/java/com/terraforged/mod/biome/map/set/BiomeSet.java b/src/main/java/com/terraforged/mod/biome/map/set/BiomeSet.java index 32774a1..340bf6c 100644 --- a/src/main/java/com/terraforged/mod/biome/map/set/BiomeSet.java +++ b/src/main/java/com/terraforged/mod/biome/map/set/BiomeSet.java @@ -1,11 +1,11 @@ package com.terraforged.mod.biome.map.set; import com.google.gson.JsonElement; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.mod.biome.provider.BiomeHelper; -import com.terraforged.core.cell.Cell; -import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.mod.util.ListUtils; +import com.terraforged.n2d.util.NoiseUtil; import net.minecraft.world.biome.Biome; import java.util.Collections; diff --git a/src/main/java/com/terraforged/mod/biome/map/set/BiomeTypeSet.java b/src/main/java/com/terraforged/mod/biome/map/set/BiomeTypeSet.java index c02dc84..bb87fb7 100644 --- a/src/main/java/com/terraforged/mod/biome/map/set/BiomeTypeSet.java +++ b/src/main/java/com/terraforged/mod/biome/map/set/BiomeTypeSet.java @@ -3,8 +3,8 @@ package com.terraforged.mod.biome.map.set; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.core.cell.Cell; +import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.world.biome.BiomeType; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/mod/biome/map/set/RiverSet.java b/src/main/java/com/terraforged/mod/biome/map/set/RiverSet.java index 49628bf..7a50bcf 100644 --- a/src/main/java/com/terraforged/mod/biome/map/set/RiverSet.java +++ b/src/main/java/com/terraforged/mod/biome/map/set/RiverSet.java @@ -1,9 +1,9 @@ package com.terraforged.mod.biome.map.set; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.mod.biome.map.defaults.DefaultBiomes; -import com.terraforged.core.cell.Cell; import net.minecraft.world.biome.Biome; import java.util.List; diff --git a/src/main/java/com/terraforged/mod/biome/map/set/TemperatureSet.java b/src/main/java/com/terraforged/mod/biome/map/set/TemperatureSet.java index 6a152c2..c53ea84 100644 --- a/src/main/java/com/terraforged/mod/biome/map/set/TemperatureSet.java +++ b/src/main/java/com/terraforged/mod/biome/map/set/TemperatureSet.java @@ -3,9 +3,9 @@ package com.terraforged.mod.biome.map.set; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.map.defaults.BiomeTemps; import com.terraforged.mod.biome.map.defaults.DefaultBiome; -import com.terraforged.core.cell.Cell; import net.minecraft.world.biome.Biome; import java.util.List; diff --git a/src/main/java/com/terraforged/mod/biome/modifier/BeachModifier.java b/src/main/java/com/terraforged/mod/biome/modifier/BeachModifier.java index 7dc1d6e..5e3d30e 100644 --- a/src/main/java/com/terraforged/mod/biome/modifier/BeachModifier.java +++ b/src/main/java/com/terraforged/mod/biome/modifier/BeachModifier.java @@ -1,8 +1,8 @@ package com.terraforged.mod.biome.modifier; import com.terraforged.api.biome.modifier.BiomeModifier; -import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.core.cell.Cell; +import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.n2d.Module; import com.terraforged.n2d.Source; import com.terraforged.world.GeneratorContext; diff --git a/src/main/java/com/terraforged/mod/biome/modifier/BiomeModifierManager.java b/src/main/java/com/terraforged/mod/biome/modifier/BiomeModifierManager.java index 59e9fbe..edbc8af 100644 --- a/src/main/java/com/terraforged/mod/biome/modifier/BiomeModifierManager.java +++ b/src/main/java/com/terraforged/mod/biome/modifier/BiomeModifierManager.java @@ -27,12 +27,12 @@ package com.terraforged.mod.biome.modifier; import com.terraforged.api.biome.modifier.BiomeModifier; import com.terraforged.api.biome.modifier.ModifierManager; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.mod.biome.provider.DesertBiomes; import com.terraforged.mod.chunk.TerraContext; -import com.terraforged.core.cell.Cell; import com.terraforged.world.biome.BiomeType; -import com.terraforged.world.terrain.ITerrain; +import com.terraforged.world.heightmap.Levels; import net.minecraft.world.biome.Biome; import java.util.ArrayList; @@ -55,8 +55,8 @@ public class BiomeModifierManager implements BiomeModifier, ModifierManager { this.biomeModifiers = modifiers; } - public boolean hasModifiers(ITerrain type) { - return type.isOverground(); + public boolean hasModifiers(Cell cell, Levels levels) { + return cell.terrain.isOverground() || (cell.terrain.isSubmerged() && cell.value > levels.water); } public DesertBiomes getDesertBiomes() { diff --git a/src/main/java/com/terraforged/mod/biome/modifier/CoastModifier.java b/src/main/java/com/terraforged/mod/biome/modifier/CoastModifier.java index 341b4c2..a19ac06 100644 --- a/src/main/java/com/terraforged/mod/biome/modifier/CoastModifier.java +++ b/src/main/java/com/terraforged/mod/biome/modifier/CoastModifier.java @@ -26,9 +26,9 @@ package com.terraforged.mod.biome.modifier; import com.terraforged.api.biome.modifier.BiomeModifier; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.mod.chunk.TerraContext; -import com.terraforged.core.cell.Cell; import com.terraforged.world.terrain.Terrains; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/mod/biome/modifier/DesertColorModifier.java b/src/main/java/com/terraforged/mod/biome/modifier/DesertColorModifier.java index f2c4614..a34ebd6 100644 --- a/src/main/java/com/terraforged/mod/biome/modifier/DesertColorModifier.java +++ b/src/main/java/com/terraforged/mod/biome/modifier/DesertColorModifier.java @@ -26,8 +26,8 @@ package com.terraforged.mod.biome.modifier; import com.terraforged.api.biome.modifier.BiomeModifier; -import com.terraforged.mod.biome.provider.DesertBiomes; import com.terraforged.core.cell.Cell; +import com.terraforged.mod.biome.provider.DesertBiomes; import net.minecraft.world.biome.Biome; public class DesertColorModifier implements BiomeModifier { diff --git a/src/main/java/com/terraforged/mod/biome/modifier/MountainModifier.java b/src/main/java/com/terraforged/mod/biome/modifier/MountainModifier.java index eed4c34..f247764 100644 --- a/src/main/java/com/terraforged/mod/biome/modifier/MountainModifier.java +++ b/src/main/java/com/terraforged/mod/biome/modifier/MountainModifier.java @@ -1,10 +1,10 @@ package com.terraforged.mod.biome.modifier; import com.terraforged.api.biome.modifier.BiomeModifier; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.mod.chunk.TerraContext; -import com.terraforged.core.cell.Cell; import net.minecraft.world.biome.Biome; public class MountainModifier implements BiomeModifier { diff --git a/src/main/java/com/terraforged/mod/biome/provider/BiomeWeights.java b/src/main/java/com/terraforged/mod/biome/provider/BiomeWeights.java index 847d0fb..fa9180f 100644 --- a/src/main/java/com/terraforged/mod/biome/provider/BiomeWeights.java +++ b/src/main/java/com/terraforged/mod/biome/provider/BiomeWeights.java @@ -9,9 +9,11 @@ import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeManager; import net.minecraftforge.registries.ForgeRegistries; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.BiConsumer; public class BiomeWeights { @@ -58,6 +60,21 @@ public class BiomeWeights { return standardWeight; } + public void forEachEntry(BiConsumer consumer) { + biomes.entrySet().stream() + .sorted(Comparator.comparing(e -> e.getKey().toString())) + .forEach(e -> consumer.accept(e.getKey(), e.getValue())); + } + + public void forEachUnregistered(BiConsumer consumer) { + for (Biome biome : ForgeRegistries.BIOMES) { + if (!biomes.containsKey(biome.getRegistryName())) { + int weight = getWeight(biome); + consumer.accept(biome.getRegistryName(), weight); + } + } + } + private void readWeights() { CommentedConfig config = ConfigManager.BIOME_WEIGHTS.get(); @@ -69,11 +86,12 @@ public class BiomeWeights { ResourceLocation name = new ResourceLocation(key); if (!ForgeRegistries.BIOMES.containsKey(name)) { + Log.err("Invalid biome defined: {}", name); continue; } biomes.put(name, weight); - Log.debug("Loaded custom biome weight: %s=%s", name, weight); + Log.debug("Loaded custom biome weight: {}={}", name, weight); } } } diff --git a/src/main/java/com/terraforged/mod/biome/provider/TerraBiomeProvider.java b/src/main/java/com/terraforged/mod/biome/provider/TerraBiomeProvider.java index 48e6fc0..730cdd5 100644 --- a/src/main/java/com/terraforged/mod/biome/provider/TerraBiomeProvider.java +++ b/src/main/java/com/terraforged/mod/biome/provider/TerraBiomeProvider.java @@ -26,11 +26,11 @@ package com.terraforged.mod.biome.provider; import com.google.common.collect.Sets; +import com.terraforged.core.cell.Cell; +import com.terraforged.core.concurrent.Resource; import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.mod.biome.modifier.BiomeModifierManager; import com.terraforged.mod.chunk.TerraContext; -import com.terraforged.core.cell.Cell; -import com.terraforged.core.concurrent.Resource; import com.terraforged.mod.util.setup.SetupHooks; import com.terraforged.world.heightmap.WorldLookup; import com.terraforged.world.terrain.decorator.Decorator; @@ -152,7 +152,7 @@ public class TerraBiomeProvider extends BiomeProvider { public Biome getBiome(Cell cell, int x, int z) { Biome biome = biomeMap.provideBiome(cell, context.levels); - if (modifierManager.hasModifiers(cell.terrain)) { + if (modifierManager.hasModifiers(cell, context.levels)) { return modifierManager.modify(biome, cell, x, z); } return biome; diff --git a/src/main/java/com/terraforged/mod/biome/spawn/SpawnSearch.java b/src/main/java/com/terraforged/mod/biome/spawn/SpawnSearch.java index f57b08a..7027d92 100644 --- a/src/main/java/com/terraforged/mod/biome/spawn/SpawnSearch.java +++ b/src/main/java/com/terraforged/mod/biome/spawn/SpawnSearch.java @@ -1,9 +1,9 @@ package com.terraforged.mod.biome.spawn; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.Log; import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.server.command.search.Search; -import com.terraforged.core.cell.Cell; import net.minecraft.util.math.BlockPos; public class SpawnSearch extends Search { diff --git a/src/main/java/com/terraforged/mod/biome/surface/DunesSurface.java b/src/main/java/com/terraforged/mod/biome/surface/DunesSurface.java index db1b026..2793dec 100644 --- a/src/main/java/com/terraforged/mod/biome/surface/DunesSurface.java +++ b/src/main/java/com/terraforged/mod/biome/surface/DunesSurface.java @@ -29,10 +29,10 @@ import com.terraforged.api.biome.surface.MaskedSurface; import com.terraforged.api.biome.surface.Surface; import com.terraforged.api.biome.surface.SurfaceContext; import com.terraforged.api.material.layer.LayerMaterial; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.provider.DesertBiomes; import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.chunk.TerraContext; -import com.terraforged.core.cell.Cell; import com.terraforged.n2d.Module; import com.terraforged.n2d.Source; import com.terraforged.n2d.func.CellFunc; diff --git a/src/main/java/com/terraforged/mod/biome/surface/IcebergsSurface.java b/src/main/java/com/terraforged/mod/biome/surface/IcebergsSurface.java index 7096b57..b651c3b 100644 --- a/src/main/java/com/terraforged/mod/biome/surface/IcebergsSurface.java +++ b/src/main/java/com/terraforged/mod/biome/surface/IcebergsSurface.java @@ -28,8 +28,8 @@ package com.terraforged.mod.biome.surface; import com.terraforged.api.biome.surface.MaskedSurface; import com.terraforged.api.biome.surface.SurfaceContext; import com.terraforged.api.material.state.States; -import com.terraforged.mod.chunk.TerraContext; import com.terraforged.core.cell.Cell; +import com.terraforged.mod.chunk.TerraContext; import com.terraforged.n2d.Module; import com.terraforged.n2d.Source; import com.terraforged.n2d.util.NoiseUtil; diff --git a/src/main/java/com/terraforged/mod/biome/tag/BiomeTagManager.java b/src/main/java/com/terraforged/mod/biome/tag/BiomeTagManager.java index f870efc..26e5ac8 100644 --- a/src/main/java/com/terraforged/mod/biome/tag/BiomeTagManager.java +++ b/src/main/java/com/terraforged/mod/biome/tag/BiomeTagManager.java @@ -25,8 +25,8 @@ package com.terraforged.mod.biome.tag; -import com.terraforged.mod.Log; import com.terraforged.api.biome.BiomeTags; +import com.terraforged.mod.Log; import net.minecraft.profiler.IProfiler; import net.minecraft.resources.IFutureReloadListener; import net.minecraft.resources.IResourceManager; diff --git a/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java b/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java index 1436c0a..36de966 100644 --- a/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java +++ b/src/main/java/com/terraforged/mod/chunk/TerraChunkGenerator.java @@ -25,9 +25,17 @@ package com.terraforged.mod.chunk; -import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.biome.surface.SurfaceManager; +import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.material.layer.LayerManager; +import com.terraforged.core.cell.Cell; +import com.terraforged.core.tile.Size; +import com.terraforged.core.tile.Tile; +import com.terraforged.core.tile.chunk.ChunkReader; +import com.terraforged.core.tile.gen.TileCache; +import com.terraforged.fm.FeatureManager; +import com.terraforged.fm.data.DataManager; +import com.terraforged.fm.structure.StructureManager; import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.chunk.generator.BiomeGenerator; import com.terraforged.mod.chunk.generator.FeatureGenerator; @@ -37,15 +45,7 @@ import com.terraforged.mod.chunk.generator.StructureGenerator; import com.terraforged.mod.chunk.generator.SurfaceGenerator; import com.terraforged.mod.chunk.generator.TerrainCarver; import com.terraforged.mod.chunk.generator.TerrainGenerator; -import com.terraforged.core.cell.Cell; -import com.terraforged.core.tile.Size; -import com.terraforged.core.tile.Tile; -import com.terraforged.core.tile.chunk.ChunkReader; -import com.terraforged.core.tile.gen.TileCache; import com.terraforged.mod.feature.BlockDataManager; -import com.terraforged.fm.FeatureManager; -import com.terraforged.fm.data.DataManager; -import com.terraforged.fm.structure.StructureManager; import com.terraforged.mod.material.Materials; import com.terraforged.mod.material.geology.GeoManager; import com.terraforged.mod.util.setup.SetupHooks; @@ -140,7 +140,7 @@ public class TerraChunkGenerator extends ChunkGenerator { @Override public final void generateSurface(WorldGenRegion world, IChunk chunk) { - surfaceGenerator.generateSurface(world, chunk); +// surfaceGenerator.generateSurface(world, chunk); } @Override diff --git a/src/main/java/com/terraforged/mod/chunk/TerraContext.java b/src/main/java/com/terraforged/mod/chunk/TerraContext.java index 092406d..b505ad0 100644 --- a/src/main/java/com/terraforged/mod/chunk/TerraContext.java +++ b/src/main/java/com/terraforged/mod/chunk/TerraContext.java @@ -26,14 +26,14 @@ package com.terraforged.mod.chunk; import com.electronwill.nightconfig.core.CommentedConfig; -import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.api.biome.surface.ChunkSurfaceBuffer; import com.terraforged.api.biome.surface.SurfaceContext; -import com.terraforged.mod.chunk.settings.TerraSettings; -import com.terraforged.mod.config.PerfDefaults; +import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.core.concurrent.thread.ThreadPools; import com.terraforged.core.tile.gen.TileCache; import com.terraforged.core.tile.gen.TileGenerator; +import com.terraforged.mod.chunk.settings.TerraSettings; +import com.terraforged.mod.config.PerfDefaults; import com.terraforged.mod.material.Materials; import com.terraforged.world.GeneratorContext; import com.terraforged.world.WorldGeneratorFactory; diff --git a/src/main/java/com/terraforged/mod/chunk/TerraSetupFactory.java b/src/main/java/com/terraforged/mod/chunk/TerraSetupFactory.java index d73f64b..ea8af3e 100644 --- a/src/main/java/com/terraforged/mod/chunk/TerraSetupFactory.java +++ b/src/main/java/com/terraforged/mod/chunk/TerraSetupFactory.java @@ -1,23 +1,7 @@ package com.terraforged.mod.chunk; -import com.terraforged.mod.Log; -import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.biome.surface.SurfaceManager; -import com.terraforged.mod.biome.ModBiomes; -import com.terraforged.mod.biome.surface.BriceSurface; -import com.terraforged.mod.biome.surface.DesertSurface; -import com.terraforged.mod.biome.surface.StoneForestSurface; -import com.terraforged.mod.biome.surface.ForestSurface; -import com.terraforged.mod.biome.surface.IcebergsSurface; -import com.terraforged.mod.biome.surface.SwampSurface; -import com.terraforged.mod.chunk.column.BedrockDecorator; -import com.terraforged.mod.chunk.column.ErosionDecorator; -import com.terraforged.mod.chunk.column.GeologyDecorator; -import com.terraforged.mod.chunk.column.post.LayerDecorator; -import com.terraforged.mod.chunk.column.post.SnowEroder; -import com.terraforged.mod.feature.BlockDataManager; -import com.terraforged.mod.feature.Matchers; -import com.terraforged.mod.feature.feature.FreezeLayer; +import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.fm.FeatureManager; import com.terraforged.fm.data.DataManager; import com.terraforged.fm.matcher.biome.BiomeMatcher; @@ -28,6 +12,22 @@ import com.terraforged.fm.predicate.FeaturePredicate; import com.terraforged.fm.predicate.MinHeight; import com.terraforged.fm.structure.StructureManager; import com.terraforged.fm.transformer.FeatureTransformer; +import com.terraforged.mod.Log; +import com.terraforged.mod.biome.ModBiomes; +import com.terraforged.mod.biome.surface.BriceSurface; +import com.terraforged.mod.biome.surface.DesertSurface; +import com.terraforged.mod.biome.surface.ForestSurface; +import com.terraforged.mod.biome.surface.IcebergsSurface; +import com.terraforged.mod.biome.surface.StoneForestSurface; +import com.terraforged.mod.biome.surface.SwampSurface; +import com.terraforged.mod.chunk.column.BedrockDecorator; +import com.terraforged.mod.chunk.column.ErosionDecorator; +import com.terraforged.mod.chunk.column.GeologyDecorator; +import com.terraforged.mod.chunk.column.post.LayerDecorator; +import com.terraforged.mod.chunk.column.post.SnowEroder; +import com.terraforged.mod.feature.BlockDataManager; +import com.terraforged.mod.feature.Matchers; +import com.terraforged.mod.feature.feature.FreezeLayer; import com.terraforged.mod.material.geology.GeoManager; import com.terraforged.mod.util.setup.SetupHooks; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/mod/chunk/column/CoastDecorator.java b/src/main/java/com/terraforged/mod/chunk/column/CoastDecorator.java index 86327a8..6f1771f 100644 --- a/src/main/java/com/terraforged/mod/chunk/column/CoastDecorator.java +++ b/src/main/java/com/terraforged/mod/chunk/column/CoastDecorator.java @@ -28,8 +28,8 @@ package com.terraforged.mod.chunk.column; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.api.material.state.States; -import com.terraforged.mod.chunk.TerraContext; import com.terraforged.core.util.VariablePredicate; +import com.terraforged.mod.chunk.TerraContext; import com.terraforged.world.terrain.Terrains; import net.minecraft.block.BlockState; import net.minecraft.world.chunk.IChunk; diff --git a/src/main/java/com/terraforged/mod/chunk/column/GeologyDecorator.java b/src/main/java/com/terraforged/mod/chunk/column/GeologyDecorator.java index 13d8943..2c8915a 100644 --- a/src/main/java/com/terraforged/mod/chunk/column/GeologyDecorator.java +++ b/src/main/java/com/terraforged/mod/chunk/column/GeologyDecorator.java @@ -25,9 +25,9 @@ package com.terraforged.mod.chunk.column; +import com.terraforged.api.biome.surface.ChunkSurfaceBuffer; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; -import com.terraforged.api.biome.surface.ChunkSurfaceBuffer; import com.terraforged.mod.material.geology.GeoManager; import net.minecraft.world.chunk.IChunk; diff --git a/src/main/java/com/terraforged/mod/chunk/generator/BiomeGenerator.java b/src/main/java/com/terraforged/mod/chunk/generator/BiomeGenerator.java index b2a4978..3bdf1a0 100644 --- a/src/main/java/com/terraforged/mod/chunk/generator/BiomeGenerator.java +++ b/src/main/java/com/terraforged/mod/chunk/generator/BiomeGenerator.java @@ -1,9 +1,9 @@ package com.terraforged.mod.chunk.generator; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.util.TerraContainer; -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/mod/chunk/generator/FeatureGenerator.java b/src/main/java/com/terraforged/mod/chunk/generator/FeatureGenerator.java index 0c4bcc0..04525ba 100644 --- a/src/main/java/com/terraforged/mod/chunk/generator/FeatureGenerator.java +++ b/src/main/java/com/terraforged/mod/chunk/generator/FeatureGenerator.java @@ -2,10 +2,10 @@ package com.terraforged.mod.chunk.generator; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorContext; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.fix.RegionFix; import com.terraforged.mod.chunk.util.TerraContainer; -import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.mod.util.Environment; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; diff --git a/src/main/java/com/terraforged/mod/chunk/generator/StructureGenerator.java b/src/main/java/com/terraforged/mod/chunk/generator/StructureGenerator.java index 7cae36a..a2dfc10 100644 --- a/src/main/java/com/terraforged/mod/chunk/generator/StructureGenerator.java +++ b/src/main/java/com/terraforged/mod/chunk/generator/StructureGenerator.java @@ -1,7 +1,7 @@ package com.terraforged.mod.chunk.generator; -import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.fm.predicate.FeaturePredicate; +import com.terraforged.mod.chunk.TerraChunkGenerator; import net.minecraft.network.DebugPacketSender; import net.minecraft.util.SharedSeedRandom; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/terraforged/mod/chunk/generator/SurfaceGenerator.java b/src/main/java/com/terraforged/mod/chunk/generator/SurfaceGenerator.java index 55b5e63..b12a6e0 100644 --- a/src/main/java/com/terraforged/mod/chunk/generator/SurfaceGenerator.java +++ b/src/main/java/com/terraforged/mod/chunk/generator/SurfaceGenerator.java @@ -1,12 +1,12 @@ package com.terraforged.mod.chunk.generator; -import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.biome.surface.ChunkSurfaceBuffer; import com.terraforged.api.biome.surface.SurfaceContext; +import com.terraforged.api.chunk.column.ColumnDecorator; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.util.FastChunk; import com.terraforged.mod.chunk.util.TerraContainer; -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/mod/chunk/generator/TerrainCarver.java b/src/main/java/com/terraforged/mod/chunk/generator/TerrainCarver.java index 1cecbfb..385ea5b 100644 --- a/src/main/java/com/terraforged/mod/chunk/generator/TerrainCarver.java +++ b/src/main/java/com/terraforged/mod/chunk/generator/TerrainCarver.java @@ -1,8 +1,8 @@ package com.terraforged.mod.chunk.generator; +import com.terraforged.fm.template.StructureUtils; import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.fix.ChunkCarverFix; -import com.terraforged.fm.template.StructureUtils; import net.minecraft.util.SharedSeedRandom; import net.minecraft.util.math.ChunkPos; import net.minecraft.world.biome.Biome; diff --git a/src/main/java/com/terraforged/mod/chunk/generator/TerrainGenerator.java b/src/main/java/com/terraforged/mod/chunk/generator/TerrainGenerator.java index fd80f56..6b7d327 100644 --- a/src/main/java/com/terraforged/mod/chunk/generator/TerrainGenerator.java +++ b/src/main/java/com/terraforged/mod/chunk/generator/TerrainGenerator.java @@ -1,11 +1,11 @@ package com.terraforged.mod.chunk.generator; import com.terraforged.api.chunk.column.DecoratorContext; +import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.column.BaseDecorator; import com.terraforged.mod.chunk.util.FastChunk; import com.terraforged.mod.chunk.util.TerraContainer; -import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.mod.feature.TerrainHelper; import com.terraforged.world.climate.Climate; import com.terraforged.world.heightmap.Levels; diff --git a/src/main/java/com/terraforged/mod/chunk/settings/DimesionSettings.java b/src/main/java/com/terraforged/mod/chunk/settings/DimesionSettings.java index ba88b7e..b0e3ad4 100644 --- a/src/main/java/com/terraforged/mod/chunk/settings/DimesionSettings.java +++ b/src/main/java/com/terraforged/mod/chunk/settings/DimesionSettings.java @@ -1,9 +1,9 @@ package com.terraforged.mod.chunk.settings; -import com.terraforged.mod.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.mod.TerraWorld; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.StringNBT; import net.minecraft.world.WorldType; diff --git a/src/main/java/com/terraforged/mod/chunk/settings/Miscellaneous.java b/src/main/java/com/terraforged/mod/chunk/settings/Miscellaneous.java index 573dbc4..86e6844 100644 --- a/src/main/java/com/terraforged/mod/chunk/settings/Miscellaneous.java +++ b/src/main/java/com/terraforged/mod/chunk/settings/Miscellaneous.java @@ -25,10 +25,10 @@ package com.terraforged.mod.chunk.settings; -import com.terraforged.mod.biome.modifier.MountainModifier; import com.terraforged.core.serialization.annotation.Comment; import com.terraforged.core.serialization.annotation.Range; import com.terraforged.core.serialization.annotation.Serializable; +import com.terraforged.mod.biome.modifier.MountainModifier; @Serializable public class Miscellaneous { diff --git a/src/main/java/com/terraforged/mod/chunk/settings/StructureSettings.java b/src/main/java/com/terraforged/mod/chunk/settings/StructureSettings.java index df5bb21..1b6578d 100644 --- a/src/main/java/com/terraforged/mod/chunk/settings/StructureSettings.java +++ b/src/main/java/com/terraforged/mod/chunk/settings/StructureSettings.java @@ -53,11 +53,11 @@ public class StructureSettings { public static class Structure { @Range(min = 1, max = 200) - @Comment("The distance (in chunks) between placements of this feature") + @Comment("The maximum distance in chunks between attempts to spawn a structure") public int distance; @Range(min = 1, max = 50) - @Comment("The separation (in chunks) between placements of this feature") + @Comment("The minimum distance in chunks between structure spawns") public int separation; public Structure() { diff --git a/src/main/java/com/terraforged/mod/chunk/test/TestBiomeProvider.java b/src/main/java/com/terraforged/mod/chunk/test/TestBiomeProvider.java index 22decc3..1a8dda9 100644 --- a/src/main/java/com/terraforged/mod/chunk/test/TestBiomeProvider.java +++ b/src/main/java/com/terraforged/mod/chunk/test/TestBiomeProvider.java @@ -25,9 +25,9 @@ package com.terraforged.mod.chunk.test; +import com.terraforged.core.cell.Cell; import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.chunk.TerraContext; -import com.terraforged.core.cell.Cell; import net.minecraft.world.biome.Biome; public class TestBiomeProvider extends TerraBiomeProvider { diff --git a/src/main/java/com/terraforged/mod/chunk/test/TestHeightMap.java b/src/main/java/com/terraforged/mod/chunk/test/TestHeightMap.java index 868dad2..d12fc7a 100644 --- a/src/main/java/com/terraforged/mod/chunk/test/TestHeightMap.java +++ b/src/main/java/com/terraforged/mod/chunk/test/TestHeightMap.java @@ -13,7 +13,6 @@ public class TestHeightMap extends Heightmap { public TestHeightMap(GeneratorContext context) { super(context); terrains = context.terrain; - System.out.println("TESTETETEST"); } @Override diff --git a/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java b/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java index bd6d9c2..740866b 100644 --- a/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java +++ b/src/main/java/com/terraforged/mod/client/gui/SettingsScreen.java @@ -112,7 +112,7 @@ public class SettingsScreen extends OverlayScreen { for (Page page : pages) { page.save(); } - parent.chunkProviderSettingsJson = NBTHelper.serializeCompact(instance.settings); + parent.chunkProviderSettingsJson = NBTHelper.stripMetadata(instance.settingsData); SettingsScreen.setSeed(parent, preview.getSeed()); onClose(); })); diff --git a/src/main/java/com/terraforged/mod/client/gui/element/TerraToggle.java b/src/main/java/com/terraforged/mod/client/gui/element/TerraToggle.java index 36e5c55..cbe3546 100644 --- a/src/main/java/com/terraforged/mod/client/gui/element/TerraToggle.java +++ b/src/main/java/com/terraforged/mod/client/gui/element/TerraToggle.java @@ -34,6 +34,7 @@ import java.util.List; public class TerraToggle extends TerraButton { + private final boolean noname; private final String prefix; private final String name; private final CompoundNBT value; @@ -50,6 +51,7 @@ public class TerraToggle extends TerraButton { this.prefix = Element.getDisplayName(name, value) + ": "; this.tooltip = Element.getToolTip(name, value); CompoundNBT meta = value.getCompound("#" + name); + this.noname = meta.contains("noname"); this.options = meta.getList("options", Constants.NBT.TAG_STRING); for (int i = 0; i < options.size(); i++) { String s = options.getString(i); @@ -58,7 +60,12 @@ public class TerraToggle extends TerraButton { break; } } - setMessage(prefix + value.getString(name)); + + if (noname) { + setMessage(value.getString(name)); + } else { + setMessage(prefix + value.getString(name)); + } } public TerraToggle callback(Runnable runnable) { @@ -92,7 +99,11 @@ public class TerraToggle extends TerraButton { } String option = options.getString(index); value.putString(name, option); - setMessage(prefix + option); + if (noname) { + setMessage(option); + } else { + setMessage(prefix + option); + } callback.run(); } } diff --git a/src/main/java/com/terraforged/mod/client/gui/preview/Preview.java b/src/main/java/com/terraforged/mod/client/gui/preview/Preview.java index a622ff2..8621b67 100644 --- a/src/main/java/com/terraforged/mod/client/gui/preview/Preview.java +++ b/src/main/java/com/terraforged/mod/client/gui/preview/Preview.java @@ -36,8 +36,8 @@ import com.terraforged.core.tile.Size; import com.terraforged.core.tile.Tile; import com.terraforged.core.tile.gen.TileGenerator; import com.terraforged.mod.client.gui.GuiKeys; -import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.mod.util.nbt.NBTHelper; +import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.world.GeneratorContext; import com.terraforged.world.continent.MutableVeci; import com.terraforged.world.heightmap.Levels; @@ -290,12 +290,12 @@ public class Preview extends Button { String terrain = cell.terrain.getName().toLowerCase(); if (terrain.contains("ocean")) { if (cell.temperature < 0.3) { - return "cold_ocean"; + return "cold_" + terrain; } if (cell.temperature > 0.6) { - return "warm_ocean"; + return "warm_" + terrain; } - return "ocean"; + return terrain; } if (terrain.contains("river")) { return "river"; diff --git a/src/main/java/com/terraforged/mod/client/gui/preview/PreviewPage.java b/src/main/java/com/terraforged/mod/client/gui/preview/PreviewPage.java index 5847ece..4aa4665 100644 --- a/src/main/java/com/terraforged/mod/client/gui/preview/PreviewPage.java +++ b/src/main/java/com/terraforged/mod/client/gui/preview/PreviewPage.java @@ -74,6 +74,7 @@ public class PreviewPage extends UpdatablePage { preview.setHeight(Preview.HEIGHT); addElements(right.left, right.top, right, previewerSettings, right.scrollPane::addButton, this::update); + right.scrollPane.addButton(new TerraButton(GuiKeys.PREVIEW_SEED.get()) { @Override public void onPress() { diff --git a/src/main/java/com/terraforged/mod/client/gui/preview/PreviewSettings.java b/src/main/java/com/terraforged/mod/client/gui/preview/PreviewSettings.java index e50f85d..b3b240e 100644 --- a/src/main/java/com/terraforged/mod/client/gui/preview/PreviewSettings.java +++ b/src/main/java/com/terraforged/mod/client/gui/preview/PreviewSettings.java @@ -26,6 +26,7 @@ package com.terraforged.mod.client.gui.preview; import com.terraforged.core.serialization.annotation.Comment; +import com.terraforged.core.serialization.annotation.NoName; import com.terraforged.core.serialization.annotation.Range; import com.terraforged.core.serialization.annotation.Serializable; @@ -36,6 +37,7 @@ public class PreviewSettings { @Comment("Controls the zoom level of the preview map") public int zoom = 100 - 32; + @NoName @Comment("Controls the rendering mode on the preview map") public RenderMode display = RenderMode.BIOME_TYPE; } diff --git a/src/main/java/com/terraforged/mod/client/gui/preview/RenderMode.java b/src/main/java/com/terraforged/mod/client/gui/preview/RenderMode.java index 5117758..54761c4 100644 --- a/src/main/java/com/terraforged/mod/client/gui/preview/RenderMode.java +++ b/src/main/java/com/terraforged/mod/client/gui/preview/RenderMode.java @@ -80,12 +80,34 @@ public enum RenderMode { return rgba(cell.region, saturation, brightness); } }, + TRANSITION_POINTS { + @Override + public int getColor(Cell cell, float scale, float bias) { + switch (cell.terrain.getType()) { + case DEEP_OCEAN: + return rgba(0.65F, 0.7F, 0.7F); + case SHALLOW_OCEAN: + return rgba(0.6F, 0.6F, 0.8F); + case BEACH: + return rgba(0.2F, 0.4F, 0.75F); + case COAST: + return rgba(0.35F, 0.75F, 0.65F); + default: + if (cell.terrain.isRiver() || cell.terrain.isWetland()) { + return rgba(0.6F, 0.6F, 0.8F); + } + return rgba(0.3F, 0.7F, 0.5F); + } + } + } ; public int getColor(Cell cell, Levels levels) { float baseHeight = levels.water; - if (cell.value < baseHeight) { - return rgba(40, 140, 200); + if (this != TRANSITION_POINTS) { + if (cell.value < baseHeight) { + return rgba(40, 140, 200); + } } float bands = 10F; float alpha = 0.2F; diff --git a/src/main/java/com/terraforged/mod/client/gui/preview2/Preview.java b/src/main/java/com/terraforged/mod/client/gui/preview2/Preview.java index c58e64e..b632080 100644 --- a/src/main/java/com/terraforged/mod/client/gui/preview2/Preview.java +++ b/src/main/java/com/terraforged/mod/client/gui/preview2/Preview.java @@ -1,13 +1,13 @@ package com.terraforged.mod.client.gui.preview2; import com.mojang.blaze3d.systems.RenderSystem; -import com.terraforged.mod.chunk.settings.TerraSettings; import com.terraforged.core.concurrent.thread.ThreadPool; import com.terraforged.core.concurrent.thread.ThreadPools; import com.terraforged.core.render.RenderAPI; import com.terraforged.core.render.RenderSettings; import com.terraforged.core.render.RenderWorld; import com.terraforged.core.tile.gen.TileGenerator; +import com.terraforged.mod.chunk.settings.TerraSettings; import com.terraforged.world.GeneratorContext; import com.terraforged.world.continent.MutableVeci; import com.terraforged.world.continent.SpawnType; diff --git a/src/main/java/com/terraforged/mod/client/gui/preview2/PreviewSettings.java b/src/main/java/com/terraforged/mod/client/gui/preview2/PreviewSettings.java index 26d06f1..292f163 100644 --- a/src/main/java/com/terraforged/mod/client/gui/preview2/PreviewSettings.java +++ b/src/main/java/com/terraforged/mod/client/gui/preview2/PreviewSettings.java @@ -1,6 +1,7 @@ package com.terraforged.mod.client.gui.preview2; import com.terraforged.core.render.RenderMode; +import com.terraforged.core.serialization.annotation.NoName; import com.terraforged.core.serialization.annotation.Range; import com.terraforged.core.serialization.annotation.Serializable; @@ -10,6 +11,7 @@ public class PreviewSettings { @Range(min = 1, max = 100) public float zoom = 90F; + @NoName public RenderMode display = RenderMode.BIOME_TYPE; public float getZoom(float scale) { diff --git a/src/main/java/com/terraforged/mod/config/PerfDefaults.java b/src/main/java/com/terraforged/mod/config/PerfDefaults.java index 3d7897c..c909051 100644 --- a/src/main/java/com/terraforged/mod/config/PerfDefaults.java +++ b/src/main/java/com/terraforged/mod/config/PerfDefaults.java @@ -1,8 +1,8 @@ package com.terraforged.mod.config; import com.electronwill.nightconfig.core.CommentedConfig; -import com.terraforged.mod.Log; import com.terraforged.core.concurrent.thread.ThreadPools; +import com.terraforged.mod.Log; public class PerfDefaults { diff --git a/src/main/java/com/terraforged/mod/data/DataGen.java b/src/main/java/com/terraforged/mod/data/DataGen.java index 13a3df4..751be65 100644 --- a/src/main/java/com/terraforged/mod/data/DataGen.java +++ b/src/main/java/com/terraforged/mod/data/DataGen.java @@ -40,6 +40,7 @@ public class DataGen { public static void dumpData() { File dataDir = new File("data"); WorldGenBiomes.genBiomeMap(dataDir); + WorldGenBiomes.genBiomeWeights(dataDir); WorldGenBlocks.genBlockTags(dataDir); WorldGenFeatures.genBiomeFeatures(dataDir); } diff --git a/src/main/java/com/terraforged/mod/data/LangGenerator.java b/src/main/java/com/terraforged/mod/data/LangGenerator.java index da76609..a4768d3 100644 --- a/src/main/java/com/terraforged/mod/data/LangGenerator.java +++ b/src/main/java/com/terraforged/mod/data/LangGenerator.java @@ -1,7 +1,7 @@ package com.terraforged.mod.data; -import com.terraforged.mod.chunk.settings.TerraSettings; import com.terraforged.core.util.NameUtil; +import com.terraforged.mod.chunk.settings.TerraSettings; import com.terraforged.mod.client.gui.GuiKeys; import com.terraforged.mod.client.gui.preview2.PreviewSettings; import com.terraforged.mod.util.TranslationKey; diff --git a/src/main/java/com/terraforged/mod/data/WorldGenBiomes.java b/src/main/java/com/terraforged/mod/data/WorldGenBiomes.java index ded748b..bea2f80 100644 --- a/src/main/java/com/terraforged/mod/data/WorldGenBiomes.java +++ b/src/main/java/com/terraforged/mod/data/WorldGenBiomes.java @@ -28,6 +28,7 @@ package com.terraforged.mod.data; import com.google.gson.GsonBuilder; import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.mod.biome.provider.BiomeHelper; +import com.terraforged.mod.biome.provider.BiomeWeights; import com.terraforged.world.biome.BiomeType; import net.minecraft.util.ResourceLocation; @@ -48,6 +49,32 @@ public class WorldGenBiomes extends DataGen { } } + public static void genBiomeWeights(File dataDir) { + BiomeWeights weights = new BiomeWeights(); + try (BufferedWriter writer = new BufferedWriter(new FileWriter(new File(dataDir, "biome_weights.txt")))) { + writer.write("# REGISTERED BIOME WEIGHTS\n"); + weights.forEachEntry((name, weight) -> { + try { + writer.write(name + "=" + weight + "\n"); + } catch (IOException e) { + e.printStackTrace(); + } + }); + + writer.write("\n"); + writer.write("# UNREGISTERED BIOME WEIGHTS\n"); + weights.forEachUnregistered((name, weight) -> { + try { + writer.write(name + "=" + weight + "\n"); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } catch (IOException e) { + e.printStackTrace(); + } + } + private static ResourceLocation getName(BiomeType type) { return new ResourceLocation("terraforged", type.name().toLowerCase()); } diff --git a/src/main/java/com/terraforged/mod/feature/BlockDataManager.java b/src/main/java/com/terraforged/mod/feature/BlockDataManager.java index 66971f4..f0a8265 100644 --- a/src/main/java/com/terraforged/mod/feature/BlockDataManager.java +++ b/src/main/java/com/terraforged/mod/feature/BlockDataManager.java @@ -1,9 +1,9 @@ package com.terraforged.mod.feature; import com.google.common.collect.ImmutableMap; -import com.terraforged.mod.feature.sapling.SaplingConfig; import com.terraforged.fm.data.DataManager; import com.terraforged.fm.util.Json; +import com.terraforged.mod.feature.sapling.SaplingConfig; import net.minecraft.block.Block; import java.util.HashMap; diff --git a/src/main/java/com/terraforged/mod/feature/Matchers.java b/src/main/java/com/terraforged/mod/feature/Matchers.java index daa0770..0825cd3 100644 --- a/src/main/java/com/terraforged/mod/feature/Matchers.java +++ b/src/main/java/com/terraforged/mod/feature/Matchers.java @@ -25,10 +25,10 @@ package com.terraforged.mod.feature; -import com.terraforged.mod.feature.feature.DiskFeature; import com.terraforged.fm.matcher.BiomeFeatureMatcher; import com.terraforged.fm.matcher.biome.BiomeMatcher; import com.terraforged.fm.matcher.feature.FeatureMatcher; +import com.terraforged.mod.feature.feature.DiskFeature; import net.minecraft.block.Blocks; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.feature.Feature; diff --git a/src/main/java/com/terraforged/mod/feature/context/ChanceContext.java b/src/main/java/com/terraforged/mod/feature/context/ChanceContext.java index 6939500..aa5c954 100644 --- a/src/main/java/com/terraforged/mod/feature/context/ChanceContext.java +++ b/src/main/java/com/terraforged/mod/feature/context/ChanceContext.java @@ -1,12 +1,12 @@ package com.terraforged.mod.feature.context; -import com.terraforged.mod.chunk.TerraChunkGenerator; -import com.terraforged.mod.chunk.fix.RegionDelegate; 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.tile.chunk.ChunkReader; +import com.terraforged.mod.chunk.TerraChunkGenerator; +import com.terraforged.mod.chunk.fix.RegionDelegate; 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/mod/feature/decorator/poisson/BiomeVariance.java b/src/main/java/com/terraforged/mod/feature/decorator/poisson/BiomeVariance.java index c9fb32a..bf52a89 100644 --- a/src/main/java/com/terraforged/mod/feature/decorator/poisson/BiomeVariance.java +++ b/src/main/java/com/terraforged/mod/feature/decorator/poisson/BiomeVariance.java @@ -1,8 +1,8 @@ package com.terraforged.mod.feature.decorator.poisson; -import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.core.cell.Cell; import com.terraforged.core.tile.chunk.ChunkReader; +import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.n2d.Module; import com.terraforged.n2d.Source; import com.terraforged.n2d.util.NoiseUtil; diff --git a/src/main/java/com/terraforged/mod/feature/sapling/SaplingConfig.java b/src/main/java/com/terraforged/mod/feature/sapling/SaplingConfig.java index f563269..e5eb8de 100644 --- a/src/main/java/com/terraforged/mod/feature/sapling/SaplingConfig.java +++ b/src/main/java/com/terraforged/mod/feature/sapling/SaplingConfig.java @@ -2,10 +2,10 @@ package com.terraforged.mod.feature.sapling; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.terraforged.mod.feature.BlockDataConfig; import com.terraforged.fm.template.TemplateManager; import com.terraforged.fm.template.feature.TemplateFeatureConfig; import com.terraforged.fm.util.Json; +import com.terraforged.mod.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/mod/feature/sapling/SaplingListener.java b/src/main/java/com/terraforged/mod/feature/sapling/SaplingListener.java index 74a6f92..e15ab4d 100644 --- a/src/main/java/com/terraforged/mod/feature/sapling/SaplingListener.java +++ b/src/main/java/com/terraforged/mod/feature/sapling/SaplingListener.java @@ -25,13 +25,13 @@ package com.terraforged.mod.feature.sapling; +import com.terraforged.fm.template.Template; +import com.terraforged.fm.template.feature.TemplateFeature; +import com.terraforged.fm.template.feature.TemplateFeatureConfig; import com.terraforged.mod.TerraWorld; import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.feature.BlockDataManager; -import com.terraforged.fm.template.Template; -import com.terraforged.fm.template.feature.TemplateFeature; -import com.terraforged.fm.template.feature.TemplateFeatureConfig; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.util.Mirror; diff --git a/src/main/java/com/terraforged/mod/material/geology/GeoManager.java b/src/main/java/com/terraforged/mod/material/geology/GeoManager.java index c1a7163..e8dc3bf 100644 --- a/src/main/java/com/terraforged/mod/material/geology/GeoManager.java +++ b/src/main/java/com/terraforged/mod/material/geology/GeoManager.java @@ -27,8 +27,8 @@ package com.terraforged.mod.material.geology; import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.geology.StrataConfig; -import com.terraforged.mod.chunk.TerraContext; import com.terraforged.core.Seed; +import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.material.Materials; import com.terraforged.n2d.Module; import com.terraforged.n2d.Source; diff --git a/src/main/java/com/terraforged/mod/server/command/TerraCommand.java b/src/main/java/com/terraforged/mod/server/command/TerraCommand.java index 80919a5..856dd1c 100644 --- a/src/main/java/com/terraforged/mod/server/command/TerraCommand.java +++ b/src/main/java/com/terraforged/mod/server/command/TerraCommand.java @@ -31,20 +31,20 @@ 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.core.cell.Cell; +import com.terraforged.core.concurrent.Resource; import com.terraforged.mod.Log; import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.chunk.settings.SettingsHelper; +import com.terraforged.mod.data.DataGen; import com.terraforged.mod.server.command.arg.BiomeArgType; import com.terraforged.mod.server.command.arg.TerrainArgType; import com.terraforged.mod.server.command.search.BiomeSearchTask; import com.terraforged.mod.server.command.search.BothSearchTask; import com.terraforged.mod.server.command.search.Search; import com.terraforged.mod.server.command.search.TerrainSearchTask; -import com.terraforged.core.cell.Cell; -import com.terraforged.core.concurrent.Resource; -import com.terraforged.mod.data.DataGen; 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/mod/server/command/search/BiomeSearchTask.java b/src/main/java/com/terraforged/mod/server/command/search/BiomeSearchTask.java index 01cd6c6..5b02027 100644 --- a/src/main/java/com/terraforged/mod/server/command/search/BiomeSearchTask.java +++ b/src/main/java/com/terraforged/mod/server/command/search/BiomeSearchTask.java @@ -1,7 +1,7 @@ package com.terraforged.mod.server.command.search; -import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.core.cell.Cell; +import com.terraforged.mod.biome.provider.TerraBiomeProvider; import net.minecraft.util.math.BlockPos; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.ChunkGenerator; diff --git a/src/main/java/com/terraforged/mod/util/setup/SetupDebug.java b/src/main/java/com/terraforged/mod/util/setup/SetupDebug.java index 75f01b9..4f7b510 100644 --- a/src/main/java/com/terraforged/mod/util/setup/SetupDebug.java +++ b/src/main/java/com/terraforged/mod/util/setup/SetupDebug.java @@ -25,9 +25,9 @@ package com.terraforged.mod.util.setup; -import com.terraforged.mod.Log; import com.terraforged.api.event.SetupEvent; import com.terraforged.core.Seed; +import com.terraforged.mod.Log; import com.terraforged.n2d.Source; import com.terraforged.n2d.source.Builder; import com.terraforged.world.geology.Strata; diff --git a/src/main/java/com/terraforged/mod/util/setup/SetupHooks.java b/src/main/java/com/terraforged/mod/util/setup/SetupHooks.java index 2c1d37c..081261f 100644 --- a/src/main/java/com/terraforged/mod/util/setup/SetupHooks.java +++ b/src/main/java/com/terraforged/mod/util/setup/SetupHooks.java @@ -26,9 +26,9 @@ package com.terraforged.mod.util.setup; import com.terraforged.api.biome.modifier.ModifierManager; +import com.terraforged.api.biome.surface.SurfaceManager; import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.DecoratorManager; -import com.terraforged.api.biome.surface.SurfaceManager; import com.terraforged.api.event.SetupEvent; import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.layer.LayerManager;