Compare commits

..

12 Commits

Author SHA1 Message Date
5f9fa110cc Allowed SPRING_FOUNTAIN to spawn under standard conditions. 2020-07-03 21:10:00 +02:00
2f8b4bcf20 Fixed the Strata generator from creating an unpleasant world of shitstone. 2020-07-03 20:23:14 +02:00
1013f92e46 Create JurisForged. 2020-07-03 17:12:54 +02:00
db28088c97 Now without biomes? Maybe 2020-07-03 13:36:01 +02:00
dags-
b4cca80243 add extra bounds checks just in case 2020-07-01 19:42:31 +01:00
dags-
dc42f1d519 - more grass on mountains
- remove squids from lakes
- tweaks to continent generator
- removed ocean scale slider (transition point sliders give far more control)
2020-06-30 22:12:16 +01:00
dags-
2edc791a3d - improve how terrain is cut out above village pieces
- further refinements to transition points
- fix incorrect preset jsons
- improve accuracy of biome lookups
2020-06-30 12:16:42 +01:00
dags-
a73058062c more improvements to settings 2020-06-29 22:55:44 +01:00
dags-
95ffc7765f improvements to transition sliders 2020-06-29 18:27:02 +01:00
dags-
058433173e Merge remote-tracking branch 'origin/master' 2020-06-28 14:55:37 +01:00
dags-
6fc16103f1 - 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
2020-06-28 14:53:35 +01:00
dags
ec8d26fa5f
Update readme 2020-06-27 15:09:48 +01:00
91 changed files with 504 additions and 563 deletions

2
Engine

@ -1 +1 @@
Subproject commit e151e3ccf02d305378c269e3086863069fdf4a12 Subproject commit 855102ba10dbabadb42574bdc7b445c7069789ed

@ -1 +1 @@
Subproject commit cba0f3516ee9aa2d11b3bd4f0e72277c17c8f39b Subproject commit 1b6d4823b5a792ca938f1add3d6d6a5c0127a09c

View File

@ -26,7 +26,7 @@ repositories {
} }
dependencies { dependencies {
implementation fg.deobf("com.terraforged:TerraForged:1.15.2-0.1.0:api") implementation fg.deobf("com.terraforged:TerraForged:1.15.2-0.1.0")
} }
``` ```

View File

@ -109,8 +109,8 @@ classes {
dependsOn(collectLibs) dependsOn(collectLibs)
} }
jar { build {
finalizedBy("reobfJar") dependsOn("reobfJar")
} }
publishing { publishing {

View File

@ -1,331 +0,0 @@
{
"biome.terraforged.bryce": "Bryce",
"biome.terraforged.cold_steppe": "Cold Steppe",
"biome.terraforged.fir_forest": "Fir Forest",
"biome.terraforged.flower_plains": "Flower Plains",
"biome.terraforged.frozen_lake": "Frozen Lake",
"biome.terraforged.lake": "Lake",
"biome.terraforged.marshland": "Marshland",
"biome.terraforged.savanna_scrub": "Savanna Scrub",
"biome.terraforged.shattered_savanna_scrub": "Shattered Savanna Scrub",
"biome.terraforged.snowy_fir_forest": "Snowy Fir Forest",
"biome.terraforged.snowy_taiga_scrub": "Snowy Taiga Scrub",
"biome.terraforged.steppe": "Steppe",
"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",
"display.terraforged.dimensions.bedrock_layer.material": "Material",
"display.terraforged.dimensions.bedrock_layer.min_depth": "Min Depth",
"display.terraforged.dimensions.bedrock_layer.variance": "Variance",
"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",
"display.terraforged.miscellaneous": "Miscellaneous",
"display.terraforged.miscellaneous.custom_biome_features": "Custom Biome Features",
"display.terraforged.miscellaneous.erosion_decorator": "Erosion Decorator",
"display.terraforged.miscellaneous.mountain_biome_usage": "Mountain Biome Usage",
"display.terraforged.miscellaneous.natural_snow_decorator": "Natural Snow Decorator",
"display.terraforged.miscellaneous.smooth_layer_decorator": "Smooth Layer Decorator",
"display.terraforged.miscellaneous.strata_decorator": "Strata Decorator",
"display.terraforged.miscellaneous.title": "Miscellaneous Settings",
"display.terraforged.miscellaneous.vanilla_water_features": "Vanilla Water Features",
"display.terraforged.preset.create": "Create",
"display.terraforged.preset.default": "Make Default",
"display.terraforged.preset.delete": "Delete",
"display.terraforged.preset.load": "Load",
"display.terraforged.preset.reset": "Reset",
"display.terraforged.preset.save": "Save",
"display.terraforged.presets.title": "Presets & Defaults",
"display.terraforged.preview": "Preview",
"display.terraforged.preview.area": "Area: ",
"display.terraforged.preview.biome": "Biome: ",
"display.terraforged.preview.display": "Display",
"display.terraforged.preview.seed": "New Seed",
"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",
"display.terraforged.structures.mansions.separation": "Separation",
"display.terraforged.structures.ocean_monuments": "Ocean Monuments",
"display.terraforged.structures.ocean_monuments.distance": "Distance",
"display.terraforged.structures.ocean_monuments.separation": "Separation",
"display.terraforged.structures.ocean_ruins": "Ocean Ruins",
"display.terraforged.structures.ocean_ruins.distance": "Distance",
"display.terraforged.structures.ocean_ruins.separation": "Separation",
"display.terraforged.structures.other_structures": "Other Structures",
"display.terraforged.structures.other_structures.distance": "Distance",
"display.terraforged.structures.other_structures.separation": "Separation",
"display.terraforged.structures.shipwrecks": "Shipwrecks",
"display.terraforged.structures.shipwrecks.distance": "Distance",
"display.terraforged.structures.shipwrecks.separation": "Separation",
"display.terraforged.structures.strongholds": "Strongholds",
"display.terraforged.structures.strongholds.distance": "Distance",
"display.terraforged.structures.strongholds.separation": "Separation",
"display.terraforged.structures.title": "Structure Settings",
"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.",
"tooltip.terraforged.miscellaneous.natural_snow_decorator": "Removes snow from the terrain where it shouldn't naturally settle",
"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"
}

View File

@ -1,4 +1,4 @@
mod_version=0.1.0-BETA-2 mod_version=0.1.0-understable-01
mc_version=1.15.2 mc_version=1.15.2
forge_version=31.2.27 forge_version=31.2.27
mcp_channel=snapshot mcp_channel=snapshot

View File

@ -35,9 +35,7 @@ public abstract class BiomeVariant extends Biome {
} }
// override to register a custom biome weight with Forge's BiomeManager (default is 10) // override to register a custom biome weight with Forge's BiomeManager (default is 10)
public void registerWeights() { public void registerWeights() {}
}
@Override @Override
public int getGrassColor(double x, double z) { public int getGrassColor(double x, double z) {

View File

@ -52,6 +52,19 @@ public interface ColumnDecorator {
} }
} }
default void fillDownSolid(DecoratorContext context, IChunk chunk, int x, int z, int from, int to, BlockState state) {
for (int dy = from; dy > to; dy--) { ;
replaceSolid(chunk, context.pos.setPos(x, dy, z), state);
}
}
static void replaceSolid(IChunk chunk, BlockPos pos, BlockState state) {
if (chunk.getBlockState(pos).isAir(chunk, pos)) {
return;
}
chunk.setBlockState(pos, state, false);
}
static float getNoise(float x, float z, int seed, float scale, float bias) { static float getNoise(float x, float z, int seed, float scale, float bias) {
return (variance.getValue(x, z, seed) * scale) + bias; return (variance.getValue(x, z, seed) * scale) + bias;
} }

View File

@ -26,8 +26,8 @@
package com.terraforged.api.event; package com.terraforged.api.event;
import com.terraforged.api.biome.modifier.ModifierManager; 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.biome.surface.SurfaceManager;
import com.terraforged.api.chunk.column.DecoratorManager;
import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.geology.GeologyManager;
import com.terraforged.api.material.layer.LayerManager; import com.terraforged.api.material.layer.LayerManager;
import com.terraforged.fm.modifier.FeatureModifiers; import com.terraforged.fm.modifier.FeatureModifiers;

View File

@ -40,6 +40,7 @@ public class WGTags {
public static final Tag<Block> CLAY = tag("wg_clay"); public static final Tag<Block> CLAY = tag("wg_clay");
public static final Tag<Block> SEDIMENT = tag("wg_sediment"); public static final Tag<Block> SEDIMENT = tag("wg_sediment");
public static final Tag<Block> ERODIBLE = tag("wg_erodible"); public static final Tag<Block> ERODIBLE = tag("wg_erodible");
public static final Tag<Block> COLD = tag("wg_cold");
public static void init() { public static void init() {

View File

@ -32,7 +32,8 @@ public class StrataConfig {
public Config soil = new Config(0, 1, 0.1F, 0.25F); public Config soil = new Config(0, 1, 0.1F, 0.25F);
public Config sediment = new Config(0, 2, 0.05F, 0.15F); public Config sediment = new Config(0, 2, 0.05F, 0.15F);
public Config clay = new Config(0, 2, 0.05F, 0.1F); public Config clay = new Config(0, 2, 0.05F, 0.1F);
public Config rock = new Config(10, 30, 0.1F, 1.5F); public Config rock = new Config(2, 4, 0.05F, 0.1F);
public Config cold = new Config(10, 30, 0.1F, 1.5F);
public static class Config { public static class Config {

View File

@ -53,7 +53,6 @@ public class FrozenLake extends BiomeVariant {
DefaultBiomeFeatures.addReedsAndPumpkins(this); DefaultBiomeFeatures.addReedsAndPumpkins(this);
DefaultBiomeFeatures.addSprings(this); DefaultBiomeFeatures.addSprings(this);
DefaultBiomeFeatures.addFreezeTopLayer(this); DefaultBiomeFeatures.addFreezeTopLayer(this);
this.addSpawn(EntityClassification.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SQUID, 2, 1, 4));
this.addSpawn(EntityClassification.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SALMON, 5, 1, 5)); this.addSpawn(EntityClassification.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SALMON, 5, 1, 5));
this.addSpawn(EntityClassification.AMBIENT, new Biome.SpawnListEntry(EntityType.BAT, 10, 8, 8)); this.addSpawn(EntityClassification.AMBIENT, new Biome.SpawnListEntry(EntityType.BAT, 10, 8, 8));
this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.SPIDER, 100, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.SPIDER, 100, 4, 4));

View File

@ -58,7 +58,6 @@ public class Lake extends BiomeVariant {
DefaultBiomeFeatures.addSprings(this); DefaultBiomeFeatures.addSprings(this);
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.SEAGRASS.withConfiguration(new SeaGrassConfig(48, 0.4D)).withPlacement(Placement.TOP_SOLID_HEIGHTMAP.configure(IPlacementConfig.NO_PLACEMENT_CONFIG))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.SEAGRASS.withConfiguration(new SeaGrassConfig(48, 0.4D)).withPlacement(Placement.TOP_SOLID_HEIGHTMAP.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)));
DefaultBiomeFeatures.addFreezeTopLayer(this); DefaultBiomeFeatures.addFreezeTopLayer(this);
this.addSpawn(EntityClassification.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SQUID, 2, 1, 4));
this.addSpawn(EntityClassification.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SALMON, 5, 1, 5)); this.addSpawn(EntityClassification.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SALMON, 5, 1, 5));
this.addSpawn(EntityClassification.AMBIENT, new Biome.SpawnListEntry(EntityType.BAT, 10, 8, 8)); this.addSpawn(EntityClassification.AMBIENT, new Biome.SpawnListEntry(EntityType.BAT, 10, 8, 8));
this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.SPIDER, 100, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.SPIDER, 100, 4, 4));

View File

@ -39,7 +39,7 @@ public class ModBiomes {
private static final ArrayList<BiomeVariant> biomes = new ArrayList<>(); private static final ArrayList<BiomeVariant> biomes = new ArrayList<>();
public static final Biome BRYCE = register(new Bryce()); /*public static final Biome BRYCE = register(new Bryce());
public static final Biome COLD_STEPPE = register(new ColdSteppe()); public static final Biome COLD_STEPPE = register(new ColdSteppe());
public static final Biome ERODED_PINNACLE = register(new StoneForest()); public static final Biome ERODED_PINNACLE = register(new StoneForest());
public static final Biome FIR_FOREST = register(new FirForest()); public static final Biome FIR_FOREST = register(new FirForest());
@ -53,7 +53,7 @@ public class ModBiomes {
public static final Biome SNOWY_TAIGA_SCRUB = register(new SnowyTaigaScrub()); public static final Biome SNOWY_TAIGA_SCRUB = register(new SnowyTaigaScrub());
public static final Biome STEPPE = register(new Steppe()); public static final Biome STEPPE = register(new Steppe());
public static final Biome TAIGA_SCRUB = register(new TaigaScrub()); public static final Biome TAIGA_SCRUB = register(new TaigaScrub());
public static final Biome WARM_BEACH = register(new WarmBeach()); public static final Biome WARM_BEACH = register(new WarmBeach());*/
private static Biome register(BiomeVariant biome) { private static Biome register(BiomeVariant biome) {
biomes.add(biome); biomes.add(biome);

View File

@ -38,7 +38,7 @@ public interface BiomeMap {
Biome getBeach(Cell cell); Biome getBeach(Cell cell);
Biome getCoast(Cell cell, Biome current); Biome getCoast(Cell cell);
Biome getRiver(Cell cell); Biome getRiver(Cell cell);

View File

@ -2,12 +2,12 @@ package com.terraforged.mod.biome.map;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; 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.defaults.DefaultBiomes;
import com.terraforged.mod.biome.map.set.BiomeSet; import com.terraforged.mod.biome.map.set.BiomeSet;
import com.terraforged.mod.biome.map.set.BiomeTypeSet; import com.terraforged.mod.biome.map.set.BiomeTypeSet;
import com.terraforged.mod.biome.map.set.RiverSet; import com.terraforged.mod.biome.map.set.RiverSet;
import com.terraforged.mod.biome.map.set.TemperatureSet; import com.terraforged.mod.biome.map.set.TemperatureSet;
import com.terraforged.core.cell.Cell;
import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.n2d.util.NoiseUtil;
import com.terraforged.world.biome.BiomeType; import com.terraforged.world.biome.BiomeType;
import com.terraforged.world.heightmap.Levels; import com.terraforged.world.heightmap.Levels;
@ -54,6 +54,7 @@ public class SimpleBiomeMap implements BiomeMap {
} }
} }
@Override
public Biome provideBiome(Cell cell, Levels levels) { public Biome provideBiome(Cell cell, Levels levels) {
TerrainType type = cell.terrain.getType(); TerrainType type = cell.terrain.getType();
if (type.isSubmerged() && cell.value > levels.water) { if (type.isSubmerged() && cell.value > levels.water) {
@ -78,15 +79,27 @@ public class SimpleBiomeMap implements BiomeMap {
} }
@Override @Override
public Biome getCoast(Cell cell, Biome current) { public Biome getCoast(Cell cell) {
int inland = land.getSize(cell); // treat land & coast biome-sets as one combined set
Biome[] inland = land.getSet(cell);
Biome[] coastal = coast.getSet(cell); Biome[] coastal = coast.getSet(cell);
int total = inland + coastal.length;
int index = NoiseUtil.round((total - 1) * cell.biome); // calculate where in the combined set the cell.biome points
if (index >= inland) { int maxIndex = inland.length + coastal.length - 1;
return coastal[index - inland]; int index = NoiseUtil.round(maxIndex * cell.biome);
// if index lies within the coast section of the set
if (index >= inland.length) {
// relativize the index to start at 0
index -= inland.length;
// shouldn't be required but check that index is within bounds
if (index < coastal.length) {
return coastal[index];
} }
return current; }
return DefaultBiomes.NONE;
} }
@Override @Override

View File

@ -1,12 +1,9 @@
package com.terraforged.mod.biome.map.defaults; package com.terraforged.mod.biome.map.defaults;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.OceanBiome;
public interface DefaultBiome { public interface DefaultBiome {
Biome NONE = new OceanBiome().setRegistryName("terraforged", "none");
Biome getBiome(float temperature); Biome getBiome(float temperature);
default Biome getDefaultBiome(float temperature) { default Biome getDefaultBiome(float temperature) {

View File

@ -6,13 +6,12 @@ import net.minecraft.world.biome.Biomes;
public class DefaultBiomes { public class DefaultBiomes {
public static final Biome NONE = Biomes.THE_VOID;
public static Biome defaultBeach(float temperature) { public static Biome defaultBeach(float temperature) {
if (temperature < 0.25) { if (temperature < 0.25) {
return Biomes.SNOWY_BEACH; return Biomes.SNOWY_BEACH;
} }
if (temperature > 0.75) {
return ModBiomes.WARM_BEACH;
}
return Biomes.BEACH; return Biomes.BEACH;
} }
@ -24,17 +23,11 @@ public class DefaultBiomes {
} }
public static Biome defaultLake(float temperature) { public static Biome defaultLake(float temperature) {
if (temperature < 0.15) { return Biomes.OCEAN;
return ModBiomes.FROZEN_LAKE;
}
return ModBiomes.LAKE;
} }
public static Biome defaultWetland(float temperature) { public static Biome defaultWetland(float temperature) {
if (temperature < 0.15) { return Biomes.SWAMP;
return ModBiomes.TAIGA_SCRUB;
}
return ModBiomes.MARSHLAND;
} }
public static Biome defaultOcean(float temperature) { public static Biome defaultOcean(float temperature) {
@ -61,19 +54,10 @@ public class DefaultBiomes {
if (temperature < 0.25) { if (temperature < 0.25) {
return Biomes.SNOWY_MOUNTAINS; return Biomes.SNOWY_MOUNTAINS;
} }
if (temperature > 0.75) { return DefaultBiomes.NONE;
return DefaultBiome.NONE;
}
return Biomes.MOUNTAINS;
} }
public static Biome defaultBiome(float temperature) { public static Biome defaultBiome(float temperature) {
if (temperature < 0.3) {
return ModBiomes.TAIGA_SCRUB;
}
if (temperature > 0.7) {
return ModBiomes.SAVANNA_SCRUB;
}
return Biomes.PLAINS; return Biomes.PLAINS;
} }

View File

@ -1,11 +1,11 @@
package com.terraforged.mod.biome.map.set; package com.terraforged.mod.biome.map.set;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.mod.biome.map.defaults.DefaultBiome;
import com.terraforged.mod.biome.provider.BiomeHelper; 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.mod.util.ListUtils;
import com.terraforged.n2d.util.NoiseUtil;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import java.util.Collections; import java.util.Collections;
@ -47,7 +47,16 @@ public abstract class BiomeSet {
if (set.length == 0) { if (set.length == 0) {
return defaultBiome.getDefaultBiome(cell.temperature); return defaultBiome.getDefaultBiome(cell.temperature);
} }
return set[NoiseUtil.round((set.length - 1) * cell.biome)];
int maxIndex = set.length - 1;
int index = NoiseUtil.round(maxIndex * cell.biome);
// shouldn't happen but safety check the bounds
if (index < 0 || index >= set.length) {
return defaultBiome.getDefaultBiome(cell.temperature);
}
return set[index];
} }
public abstract int getIndex(Cell cell); public abstract int getIndex(Cell cell);

View File

@ -3,8 +3,8 @@ package com.terraforged.mod.biome.map.set;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.terraforged.mod.biome.map.defaults.DefaultBiome;
import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.map.defaults.DefaultBiome;
import com.terraforged.world.biome.BiomeType; import com.terraforged.world.biome.BiomeType;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;

View File

@ -1,9 +1,9 @@
package com.terraforged.mod.biome.map.set; 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.BiomeMap;
import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.mod.biome.map.defaults.DefaultBiome;
import com.terraforged.mod.biome.map.defaults.DefaultBiomes; import com.terraforged.mod.biome.map.defaults.DefaultBiomes;
import com.terraforged.core.cell.Cell;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import java.util.List; import java.util.List;

View File

@ -3,9 +3,9 @@ package com.terraforged.mod.biome.map.set;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; 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.BiomeTemps;
import com.terraforged.mod.biome.map.defaults.DefaultBiome; import com.terraforged.mod.biome.map.defaults.DefaultBiome;
import com.terraforged.core.cell.Cell;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import java.util.List; import java.util.List;

View File

@ -1,8 +1,8 @@
package com.terraforged.mod.biome.modifier; package com.terraforged.mod.biome.modifier;
import com.terraforged.api.biome.modifier.BiomeModifier; import com.terraforged.api.biome.modifier.BiomeModifier;
import com.terraforged.mod.biome.map.BiomeMap;
import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.map.BiomeMap;
import com.terraforged.n2d.Module; import com.terraforged.n2d.Module;
import com.terraforged.n2d.Source; import com.terraforged.n2d.Source;
import com.terraforged.world.GeneratorContext; import com.terraforged.world.GeneratorContext;
@ -20,7 +20,7 @@ public class BeachModifier implements BiomeModifier {
public BeachModifier(BiomeMap biomeMap, GeneratorContext context) { public BeachModifier(BiomeMap biomeMap, GeneratorContext context) {
this.biomes = biomeMap; this.biomes = biomeMap;
this.height = context.levels.water(6); this.height = context.levels.water(6);
this.noise = Source.perlin(context.seed.next(), 10, 1).scale(context.levels.scale(5)); this.noise = Source.perlin(context.seed.next(), 15, 1).scale(context.levels.scale(5));
} }
@Override @Override

View File

@ -27,12 +27,12 @@ package com.terraforged.mod.biome.modifier;
import com.terraforged.api.biome.modifier.BiomeModifier; import com.terraforged.api.biome.modifier.BiomeModifier;
import com.terraforged.api.biome.modifier.ModifierManager; 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.map.BiomeMap;
import com.terraforged.mod.biome.provider.DesertBiomes; import com.terraforged.mod.biome.provider.DesertBiomes;
import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.core.cell.Cell;
import com.terraforged.world.biome.BiomeType; 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 net.minecraft.world.biome.Biome;
import java.util.ArrayList; import java.util.ArrayList;
@ -55,8 +55,8 @@ public class BiomeModifierManager implements BiomeModifier, ModifierManager {
this.biomeModifiers = modifiers; this.biomeModifiers = modifiers;
} }
public boolean hasModifiers(ITerrain type) { public boolean hasModifiers(Cell cell, Levels levels) {
return type.isOverground(); return cell.terrain.isOverground() || (cell.terrain.isSubmerged() && cell.value > levels.water);
} }
public DesertBiomes getDesertBiomes() { public DesertBiomes getDesertBiomes() {

View File

@ -26,9 +26,10 @@
package com.terraforged.mod.biome.modifier; package com.terraforged.mod.biome.modifier;
import com.terraforged.api.biome.modifier.BiomeModifier; import com.terraforged.api.biome.modifier.BiomeModifier;
import com.terraforged.mod.biome.map.BiomeMap;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.map.BiomeMap;
import com.terraforged.mod.biome.map.defaults.DefaultBiomes;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.world.terrain.Terrains; import com.terraforged.world.terrain.Terrains;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
@ -57,7 +58,10 @@ public class CoastModifier implements BiomeModifier {
@Override @Override
public Biome modify(Biome in, Cell cell, int x, int z) { public Biome modify(Biome in, Cell cell, int x, int z) {
if (cell.terrain.isCoast()) { if (cell.terrain.isCoast()) {
return biomeMap.getCoast(cell, in); Biome coast = biomeMap.getCoast(cell);
if (coast != DefaultBiomes.NONE) {
return coast;
}
} }
return in; return in;
} }

View File

@ -26,8 +26,8 @@
package com.terraforged.mod.biome.modifier; package com.terraforged.mod.biome.modifier;
import com.terraforged.api.biome.modifier.BiomeModifier; import com.terraforged.api.biome.modifier.BiomeModifier;
import com.terraforged.mod.biome.provider.DesertBiomes;
import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.provider.DesertBiomes;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
public class DesertColorModifier implements BiomeModifier { public class DesertColorModifier implements BiomeModifier {

View File

@ -1,10 +1,10 @@
package com.terraforged.mod.biome.modifier; package com.terraforged.mod.biome.modifier;
import com.terraforged.api.biome.modifier.BiomeModifier; import com.terraforged.api.biome.modifier.BiomeModifier;
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 com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.map.BiomeMap;
import com.terraforged.mod.biome.map.defaults.DefaultBiomes;
import com.terraforged.mod.chunk.TerraContext;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
public class MountainModifier implements BiomeModifier { public class MountainModifier implements BiomeModifier {
@ -38,7 +38,7 @@ public class MountainModifier implements BiomeModifier {
@Override @Override
public Biome modify(Biome in, Cell cell, int x, int z) { public Biome modify(Biome in, Cell cell, int x, int z) {
Biome mountain = biomes.getMountain(cell); Biome mountain = biomes.getMountain(cell);
if (mountain != DefaultBiome.NONE) { if (mountain != DefaultBiomes.NONE) {
return mountain; return mountain;
} }
return in; return in;

View File

@ -107,8 +107,6 @@ public class BiomeHelper {
builder.addLand(BiomeType.TEMPERATE_RAINFOREST, Biomes.PLAINS, 5); builder.addLand(BiomeType.TEMPERATE_RAINFOREST, Biomes.PLAINS, 5);
builder.addLand(BiomeType.TEMPERATE_FOREST, Biomes.FLOWER_FOREST, 2); builder.addLand(BiomeType.TEMPERATE_FOREST, Biomes.FLOWER_FOREST, 2);
builder.addLand(BiomeType.TEMPERATE_FOREST, Biomes.PLAINS, 5); builder.addLand(BiomeType.TEMPERATE_FOREST, Biomes.PLAINS, 5);
builder.addLand(BiomeType.TUNDRA, ModBiomes.SNOWY_TAIGA_SCRUB, 2);
builder.addLand(BiomeType.TAIGA, ModBiomes.TAIGA_SCRUB, 2);
return builder.build(); return builder.build();
} }

View File

@ -9,9 +9,11 @@ import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeManager; import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.BiConsumer;
public class BiomeWeights { public class BiomeWeights {
@ -58,6 +60,21 @@ public class BiomeWeights {
return standardWeight; return standardWeight;
} }
public void forEachEntry(BiConsumer<ResourceLocation, Integer> consumer) {
biomes.entrySet().stream()
.sorted(Comparator.comparing(e -> e.getKey().toString()))
.forEach(e -> consumer.accept(e.getKey(), e.getValue()));
}
public void forEachUnregistered(BiConsumer<ResourceLocation, Integer> consumer) {
for (Biome biome : ForgeRegistries.BIOMES) {
if (!biomes.containsKey(biome.getRegistryName())) {
int weight = getWeight(biome);
consumer.accept(biome.getRegistryName(), weight);
}
}
}
private void readWeights() { private void readWeights() {
CommentedConfig config = ConfigManager.BIOME_WEIGHTS.get(); CommentedConfig config = ConfigManager.BIOME_WEIGHTS.get();
@ -69,11 +86,12 @@ public class BiomeWeights {
ResourceLocation name = new ResourceLocation(key); ResourceLocation name = new ResourceLocation(key);
if (!ForgeRegistries.BIOMES.containsKey(name)) { if (!ForgeRegistries.BIOMES.containsKey(name)) {
Log.err("Invalid biome defined: {}", name);
continue; continue;
} }
biomes.put(name, weight); biomes.put(name, weight);
Log.debug("Loaded custom biome weight: %s=%s", name, weight); Log.debug("Loaded custom biome weight: {}={}", name, weight);
} }
} }
} }

View File

@ -26,11 +26,11 @@
package com.terraforged.mod.biome.provider; package com.terraforged.mod.biome.provider;
import com.google.common.collect.Sets; 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.map.BiomeMap;
import com.terraforged.mod.biome.modifier.BiomeModifierManager; import com.terraforged.mod.biome.modifier.BiomeModifierManager;
import com.terraforged.mod.chunk.TerraContext; 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.mod.util.setup.SetupHooks;
import com.terraforged.world.heightmap.WorldLookup; import com.terraforged.world.heightmap.WorldLookup;
import com.terraforged.world.terrain.decorator.Decorator; import com.terraforged.world.terrain.decorator.Decorator;
@ -69,6 +69,12 @@ public class TerraBiomeProvider extends BiomeProvider {
return getWorldLookup().getCell(x, z); return getWorldLookup().getCell(x, z);
} }
public Biome getBiome(int x, int z) {
try (Resource<Cell> resource = getWorldLookup().getCell(x, z, true)) {
return getBiome(resource.get(), x, z);
}
}
@Override @Override
public Biome getNoiseBiome(int x, int y, int z) { public Biome getNoiseBiome(int x, int y, int z) {
x = (x << 2); x = (x << 2);
@ -152,7 +158,7 @@ public class TerraBiomeProvider extends BiomeProvider {
public Biome getBiome(Cell cell, int x, int z) { public Biome getBiome(Cell cell, int x, int z) {
Biome biome = biomeMap.provideBiome(cell, context.levels); 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 modifierManager.modify(biome, cell, x, z);
} }
return biome; return biome;

View File

@ -1,9 +1,9 @@
package com.terraforged.mod.biome.spawn; package com.terraforged.mod.biome.spawn;
import com.terraforged.core.cell.Cell;
import com.terraforged.mod.Log; import com.terraforged.mod.Log;
import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.biome.provider.TerraBiomeProvider;
import com.terraforged.mod.server.command.search.Search; import com.terraforged.mod.server.command.search.Search;
import com.terraforged.core.cell.Cell;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
public class SpawnSearch extends Search { public class SpawnSearch extends Search {

View File

@ -29,10 +29,10 @@ import com.terraforged.api.biome.surface.MaskedSurface;
import com.terraforged.api.biome.surface.Surface; import com.terraforged.api.biome.surface.Surface;
import com.terraforged.api.biome.surface.SurfaceContext; import com.terraforged.api.biome.surface.SurfaceContext;
import com.terraforged.api.material.layer.LayerMaterial; 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.DesertBiomes;
import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.biome.provider.TerraBiomeProvider;
import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.core.cell.Cell;
import com.terraforged.n2d.Module; import com.terraforged.n2d.Module;
import com.terraforged.n2d.Source; import com.terraforged.n2d.Source;
import com.terraforged.n2d.func.CellFunc; import com.terraforged.n2d.func.CellFunc;

View File

@ -28,8 +28,8 @@ package com.terraforged.mod.biome.surface;
import com.terraforged.api.biome.surface.MaskedSurface; import com.terraforged.api.biome.surface.MaskedSurface;
import com.terraforged.api.biome.surface.SurfaceContext; import com.terraforged.api.biome.surface.SurfaceContext;
import com.terraforged.api.material.state.States; import com.terraforged.api.material.state.States;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Cell;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.n2d.Module; import com.terraforged.n2d.Module;
import com.terraforged.n2d.Source; import com.terraforged.n2d.Source;
import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.n2d.util.NoiseUtil;

View File

@ -25,8 +25,8 @@
package com.terraforged.mod.biome.tag; package com.terraforged.mod.biome.tag;
import com.terraforged.mod.Log;
import com.terraforged.api.biome.BiomeTags; import com.terraforged.api.biome.BiomeTags;
import com.terraforged.mod.Log;
import net.minecraft.profiler.IProfiler; import net.minecraft.profiler.IProfiler;
import net.minecraft.resources.IFutureReloadListener; import net.minecraft.resources.IFutureReloadListener;
import net.minecraft.resources.IResourceManager; import net.minecraft.resources.IResourceManager;

View File

@ -25,9 +25,17 @@
package com.terraforged.mod.chunk; package com.terraforged.mod.chunk;
import com.terraforged.api.chunk.column.ColumnDecorator;
import com.terraforged.api.biome.surface.SurfaceManager; import com.terraforged.api.biome.surface.SurfaceManager;
import com.terraforged.api.chunk.column.ColumnDecorator;
import com.terraforged.api.material.layer.LayerManager; 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.biome.provider.TerraBiomeProvider;
import com.terraforged.mod.chunk.generator.BiomeGenerator; import com.terraforged.mod.chunk.generator.BiomeGenerator;
import com.terraforged.mod.chunk.generator.FeatureGenerator; 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.SurfaceGenerator;
import com.terraforged.mod.chunk.generator.TerrainCarver; import com.terraforged.mod.chunk.generator.TerrainCarver;
import com.terraforged.mod.chunk.generator.TerrainGenerator; 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.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.Materials;
import com.terraforged.mod.material.geology.GeoManager; import com.terraforged.mod.material.geology.GeoManager;
import com.terraforged.mod.util.setup.SetupHooks; import com.terraforged.mod.util.setup.SetupHooks;

View File

@ -26,14 +26,14 @@
package com.terraforged.mod.chunk; package com.terraforged.mod.chunk;
import com.electronwill.nightconfig.core.CommentedConfig; 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.ChunkSurfaceBuffer;
import com.terraforged.api.biome.surface.SurfaceContext; import com.terraforged.api.biome.surface.SurfaceContext;
import com.terraforged.mod.chunk.settings.TerraSettings; import com.terraforged.api.chunk.column.DecoratorContext;
import com.terraforged.mod.config.PerfDefaults;
import com.terraforged.core.concurrent.thread.ThreadPools; import com.terraforged.core.concurrent.thread.ThreadPools;
import com.terraforged.core.tile.gen.TileCache; import com.terraforged.core.tile.gen.TileCache;
import com.terraforged.core.tile.gen.TileGenerator; 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.mod.material.Materials;
import com.terraforged.world.GeneratorContext; import com.terraforged.world.GeneratorContext;
import com.terraforged.world.WorldGeneratorFactory; import com.terraforged.world.WorldGeneratorFactory;

View File

@ -1,14 +1,26 @@
package com.terraforged.mod.chunk; 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.api.biome.surface.SurfaceManager;
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;
import com.terraforged.fm.matcher.feature.FeatureMatcher;
import com.terraforged.fm.modifier.FeatureModifiers;
import com.terraforged.fm.predicate.DeepWater;
import com.terraforged.fm.predicate.FeaturePredicate;
import com.terraforged.fm.predicate.MaxHeight;
import com.terraforged.fm.predicate.MinDepth;
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.ModBiomes;
import com.terraforged.mod.biome.surface.BriceSurface; import com.terraforged.mod.biome.surface.BriceSurface;
import com.terraforged.mod.biome.surface.DesertSurface; 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.ForestSurface;
import com.terraforged.mod.biome.surface.IcebergsSurface; 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.biome.surface.SwampSurface;
import com.terraforged.mod.chunk.column.BedrockDecorator; import com.terraforged.mod.chunk.column.BedrockDecorator;
import com.terraforged.mod.chunk.column.ErosionDecorator; import com.terraforged.mod.chunk.column.ErosionDecorator;
@ -18,16 +30,6 @@ import com.terraforged.mod.chunk.column.post.SnowEroder;
import com.terraforged.mod.feature.BlockDataManager; import com.terraforged.mod.feature.BlockDataManager;
import com.terraforged.mod.feature.Matchers; import com.terraforged.mod.feature.Matchers;
import com.terraforged.mod.feature.feature.FreezeLayer; import com.terraforged.mod.feature.feature.FreezeLayer;
import com.terraforged.fm.FeatureManager;
import com.terraforged.fm.data.DataManager;
import com.terraforged.fm.matcher.biome.BiomeMatcher;
import com.terraforged.fm.matcher.feature.FeatureMatcher;
import com.terraforged.fm.modifier.FeatureModifiers;
import com.terraforged.fm.predicate.DeepWater;
import com.terraforged.fm.predicate.FeaturePredicate;
import com.terraforged.fm.predicate.MinHeight;
import com.terraforged.fm.structure.StructureManager;
import com.terraforged.fm.transformer.FeatureTransformer;
import com.terraforged.mod.material.geology.GeoManager; import com.terraforged.mod.material.geology.GeoManager;
import com.terraforged.mod.util.setup.SetupHooks; import com.terraforged.mod.util.setup.SetupHooks;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
@ -79,15 +81,10 @@ public class TerraSetupFactory {
public static FeatureManager createFeatureManager(DataManager data, TerraContext context) { public static FeatureManager createFeatureManager(DataManager data, TerraContext context) {
FeatureModifiers modifiers = FeatureManager.modifiers(data, context.terraSettings.miscellaneous.customBiomeFeatures); FeatureModifiers modifiers = FeatureManager.modifiers(data, context.terraSettings.miscellaneous.customBiomeFeatures);
if (context.terraSettings.miscellaneous.strataDecorator) {
// block stone blobs if strata enabled
modifiers.getPredicates().add(Matchers.stoneBlobs(), FeaturePredicate.DENY);
}
if (!context.terraSettings.miscellaneous.vanillaWaterFeatures) { if (!context.terraSettings.miscellaneous.vanillaWaterFeatures) {
// block lakes and springs if not enabled // block lakes and springs if not enabled
modifiers.getPredicates().add(FeatureMatcher.of(Feature.LAKE), FeaturePredicate.DENY); modifiers.getPredicates().add(FeatureMatcher.of(Feature.LAKE), FeaturePredicate.DENY);
modifiers.getPredicates().add(FeatureMatcher.of(Feature.SPRING_FEATURE), FeaturePredicate.DENY); //modifiers.getPredicates().add(FeatureMatcher.of(Feature.SPRING_FEATURE), FeaturePredicate.DENY);
} }
if (context.terraSettings.miscellaneous.customBiomeFeatures) { if (context.terraSettings.miscellaneous.customBiomeFeatures) {
@ -105,6 +102,7 @@ public class TerraSetupFactory {
// block ugly features // block ugly features
modifiers.getPredicates().add(Matchers.sedimentDisks(), FeaturePredicate.DENY); modifiers.getPredicates().add(Matchers.sedimentDisks(), FeaturePredicate.DENY);
modifiers.getPredicates().add(FeatureMatcher.of(Feature.MINESHAFT), new MinHeight(context.levels.waterY + 20)); modifiers.getPredicates().add(FeatureMatcher.of(Feature.MINESHAFT), new MinHeight(context.levels.waterY + 20));
modifiers.getPredicates().add(FeatureMatcher.of(Feature.WOODLAND_MANSION), new MaxHeight(context.levels.waterY + 64));
return FeatureManager.create(SetupHooks.setup(modifiers, context.copy())); return FeatureManager.create(SetupHooks.setup(modifiers, context.copy()));
} }
@ -113,19 +111,12 @@ public class TerraSetupFactory {
SurfaceManager manager = new SurfaceManager(); SurfaceManager manager = new SurfaceManager();
manager.replace(Biomes.DEEP_FROZEN_OCEAN, new IcebergsSurface(context, 30, 30)); manager.replace(Biomes.DEEP_FROZEN_OCEAN, new IcebergsSurface(context, 30, 30));
manager.replace(Biomes.FROZEN_OCEAN, new IcebergsSurface(context, 20, 15)); manager.replace(Biomes.FROZEN_OCEAN, new IcebergsSurface(context, 20, 15));
manager.append(ModBiomes.BRYCE, new BriceSurface(context.seed));
manager.append(ModBiomes.ERODED_PINNACLE, new StoneForestSurface(context.seed));
manager.append( manager.append(
new DesertSurface(context), new DesertSurface(context),
Biomes.DESERT, Biomes.DESERT,
Biomes.DESERT_HILLS, Biomes.DESERT_HILLS,
Biomes.DESERT_LAKES Biomes.DESERT_LAKES
); );
manager.replace(
new SwampSurface(),
Biomes.SWAMP.delegate.get(),
ModBiomes.MARSHLAND
);
manager.append( manager.append(
new ForestSurface(context), new ForestSurface(context),
Biomes.FOREST, Biomes.FOREST,
@ -140,6 +131,7 @@ public class TerraSetupFactory {
StructureManager manager = new StructureManager(); StructureManager manager = new StructureManager();
manager.register(Structure.OCEAN_MONUMENT, DeepWater.INSTANCE); manager.register(Structure.OCEAN_MONUMENT, DeepWater.INSTANCE);
manager.register(Structure.OCEAN_RUIN, DeepWater.INSTANCE); manager.register(Structure.OCEAN_RUIN, DeepWater.INSTANCE);
manager.register(Structure.SHIPWRECK, new MinDepth(context.levels.waterLevel - 8));
return SetupHooks.setup(manager, context); return SetupHooks.setup(manager, context);
} }

View File

@ -28,8 +28,8 @@ package com.terraforged.mod.chunk.column;
import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.ColumnDecorator;
import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.api.chunk.column.DecoratorContext;
import com.terraforged.api.material.state.States; import com.terraforged.api.material.state.States;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.core.util.VariablePredicate; import com.terraforged.core.util.VariablePredicate;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.world.terrain.Terrains; import com.terraforged.world.terrain.Terrains;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.world.chunk.IChunk; import net.minecraft.world.chunk.IChunk;

View File

@ -96,7 +96,7 @@ public class ErosionDecorator implements ColumnDecorator {
erodeRock(context, chunk, x, y, z); erodeRock(context, chunk, x, y, z);
return; return;
} else { } else {
fillDown(context, chunk, x, z, y, y - 4, material); fillDownSolid(context, chunk, x, z, y, y - 4, material);
} }
} }
placeScree(chunk, context, x, y, z); placeScree(chunk, context, x, y, z);
@ -105,7 +105,7 @@ public class ErosionDecorator implements ColumnDecorator {
protected void erodeRock(DecoratorContext context, IChunk chunk, int dx, int y, int dz) { protected void erodeRock(DecoratorContext context, IChunk chunk, int dx, int y, int dz) {
int depth = 32; int depth = 32;
BlockState material = Blocks.GRAVEL.getDefaultState(); BlockState material = States.GRAVEL.get();
// find the uppermost layer of rock & record it's depth // find the uppermost layer of rock & record it's depth
for (int dy = 3; dy < 32; dy++) { for (int dy = 3; dy < 32; dy++) {
context.pos.setPos(dx, y - dy, dz); context.pos.setPos(dx, y - dy, dz);
@ -119,8 +119,7 @@ public class ErosionDecorator implements ColumnDecorator {
// fill downwards to the first rock layer // fill downwards to the first rock layer
for (int dy = 0; dy < depth; dy++) { for (int dy = 0; dy < depth; dy++) {
context.pos.setPos(dx, y - dy, dz); ColumnDecorator.replaceSolid(chunk, context.pos.setPos(dx, y - dy, dz), material);
chunk.setBlockState(context.pos, material, false);
} }
} }
@ -133,7 +132,7 @@ public class ErosionDecorator implements ColumnDecorator {
float sediment = context.cell.sediment * SEDIMENT_MODIFIER; float sediment = context.cell.sediment * SEDIMENT_MODIFIER;
float noise = context.climate.getRand().getValue(x, z, seed3) * SEDIMENT_NOISE; float noise = context.climate.getRand().getValue(x, z, seed3) * SEDIMENT_NOISE;
if (sediment + noise > SCREE_VALUE) { if (sediment + noise > SCREE_VALUE) {
fillDown(context, chunk, x, z, y, y - 2, States.GRAVEL.get()); fillDownSolid(context, chunk, x, z, y, y - 2, States.GRAVEL.get());
} }
} }

View File

@ -25,9 +25,9 @@
package com.terraforged.mod.chunk.column; 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.ColumnDecorator;
import com.terraforged.api.chunk.column.DecoratorContext; import com.terraforged.api.chunk.column.DecoratorContext;
import com.terraforged.api.biome.surface.ChunkSurfaceBuffer;
import com.terraforged.mod.material.geology.GeoManager; import com.terraforged.mod.material.geology.GeoManager;
import net.minecraft.world.chunk.IChunk; import net.minecraft.world.chunk.IChunk;
@ -48,8 +48,7 @@ public class GeologyDecorator implements ColumnDecorator {
public void decorate(ChunkSurfaceBuffer buffer, DecoratorContext context, int x, int y, int z) { public void decorate(ChunkSurfaceBuffer buffer, DecoratorContext context, int x, int y, int z) {
int top = buffer.getSurfaceBottom(); int top = buffer.getSurfaceBottom();
geology.getGeology(context.biome).getStrata(x, z).downwards(x, top, z, context.depthBuffer.get(), (py, state) -> { geology.getGeology(context.biome).getStrata(x, z).downwards(x, top, z, context.depthBuffer.get(), (py, state) -> {
context.pos.setPos(x, py, z); ColumnDecorator.replaceSolid(buffer.getDelegate(), context.pos.setPos(x, py, z), state);
buffer.getDelegate().setBlockState(context.pos, state, false);
return true; return true;
}); });
} }

View File

@ -1,9 +1,9 @@
package com.terraforged.mod.chunk.generator; package com.terraforged.mod.chunk.generator;
import com.terraforged.core.tile.chunk.ChunkReader;
import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.biome.provider.TerraBiomeProvider;
import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.TerraChunkGenerator;
import com.terraforged.mod.chunk.util.TerraContainer; import com.terraforged.mod.chunk.util.TerraContainer;
import com.terraforged.core.tile.chunk.ChunkReader;
import com.terraforged.world.terrain.decorator.Decorator; import com.terraforged.world.terrain.decorator.Decorator;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;

View File

@ -2,10 +2,10 @@ package com.terraforged.mod.chunk.generator;
import com.terraforged.api.chunk.column.ColumnDecorator; import com.terraforged.api.chunk.column.ColumnDecorator;
import com.terraforged.api.chunk.column.DecoratorContext; 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.TerraChunkGenerator;
import com.terraforged.mod.chunk.fix.RegionFix; import com.terraforged.mod.chunk.fix.RegionFix;
import com.terraforged.mod.chunk.util.TerraContainer; import com.terraforged.mod.chunk.util.TerraContainer;
import com.terraforged.core.tile.chunk.ChunkReader;
import com.terraforged.mod.util.Environment; import com.terraforged.mod.util.Environment;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;

View File

@ -1,7 +1,7 @@
package com.terraforged.mod.chunk.generator; package com.terraforged.mod.chunk.generator;
import com.terraforged.mod.chunk.TerraChunkGenerator;
import com.terraforged.fm.predicate.FeaturePredicate; import com.terraforged.fm.predicate.FeaturePredicate;
import com.terraforged.mod.chunk.TerraChunkGenerator;
import net.minecraft.network.DebugPacketSender; import net.minecraft.network.DebugPacketSender;
import net.minecraft.util.SharedSeedRandom; import net.minecraft.util.SharedSeedRandom;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;

View File

@ -1,12 +1,12 @@
package com.terraforged.mod.chunk.generator; 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.ChunkSurfaceBuffer;
import com.terraforged.api.biome.surface.SurfaceContext; 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.TerraChunkGenerator;
import com.terraforged.mod.chunk.util.FastChunk; import com.terraforged.mod.chunk.util.FastChunk;
import com.terraforged.mod.chunk.util.TerraContainer; import com.terraforged.mod.chunk.util.TerraContainer;
import com.terraforged.core.tile.chunk.ChunkReader;
import net.minecraft.util.SharedSeedRandom; import net.minecraft.util.SharedSeedRandom;
import net.minecraft.world.chunk.IChunk; import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.gen.Heightmap; import net.minecraft.world.gen.Heightmap;

View File

@ -1,8 +1,8 @@
package com.terraforged.mod.chunk.generator; package com.terraforged.mod.chunk.generator;
import com.terraforged.fm.template.StructureUtils;
import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.TerraChunkGenerator;
import com.terraforged.mod.chunk.fix.ChunkCarverFix; import com.terraforged.mod.chunk.fix.ChunkCarverFix;
import com.terraforged.fm.template.StructureUtils;
import net.minecraft.util.SharedSeedRandom; import net.minecraft.util.SharedSeedRandom;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;

View File

@ -1,11 +1,11 @@
package com.terraforged.mod.chunk.generator; package com.terraforged.mod.chunk.generator;
import com.terraforged.api.chunk.column.DecoratorContext; 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.TerraChunkGenerator;
import com.terraforged.mod.chunk.column.BaseDecorator; import com.terraforged.mod.chunk.column.BaseDecorator;
import com.terraforged.mod.chunk.util.FastChunk; import com.terraforged.mod.chunk.util.FastChunk;
import com.terraforged.mod.chunk.util.TerraContainer; import com.terraforged.mod.chunk.util.TerraContainer;
import com.terraforged.core.tile.chunk.ChunkReader;
import com.terraforged.mod.feature.TerrainHelper; import com.terraforged.mod.feature.TerrainHelper;
import com.terraforged.world.climate.Climate; import com.terraforged.world.climate.Climate;
import com.terraforged.world.heightmap.Levels; import com.terraforged.world.heightmap.Levels;
@ -26,7 +26,7 @@ public class TerrainGenerator implements Generator.Terrain {
this.levels = generator.getContext().levels; this.levels = generator.getContext().levels;
this.terrain = generator.getContext().terrain; this.terrain = generator.getContext().terrain;
this.climate = generator.getContext().factory.getClimate(); this.climate = generator.getContext().factory.getClimate();
this.terrainHelper = new TerrainHelper(0.75F); this.terrainHelper = new TerrainHelper(0.75F, 4F);
} }
@Override @Override

View File

@ -1,9 +1,9 @@
package com.terraforged.mod.chunk.settings; package com.terraforged.mod.chunk.settings;
import com.terraforged.mod.TerraWorld;
import com.terraforged.core.serialization.annotation.Comment; import com.terraforged.core.serialization.annotation.Comment;
import com.terraforged.core.serialization.annotation.Range; import com.terraforged.core.serialization.annotation.Range;
import com.terraforged.core.serialization.annotation.Serializable; import com.terraforged.core.serialization.annotation.Serializable;
import com.terraforged.mod.TerraWorld;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.StringNBT; import net.minecraft.nbt.StringNBT;
import net.minecraft.world.WorldType; import net.minecraft.world.WorldType;

View File

@ -25,10 +25,10 @@
package com.terraforged.mod.chunk.settings; 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.Comment;
import com.terraforged.core.serialization.annotation.Range; import com.terraforged.core.serialization.annotation.Range;
import com.terraforged.core.serialization.annotation.Serializable; import com.terraforged.core.serialization.annotation.Serializable;
import com.terraforged.mod.biome.modifier.MountainModifier;
@Serializable @Serializable
public class Miscellaneous { public class Miscellaneous {

View File

@ -31,6 +31,28 @@ public class SettingsHelper {
} }
} }
public static TerraSettings loadSettings(File file) {
TerraSettings settings = new TerraSettings();
try (Reader reader = new BufferedReader(new FileReader(file))) {
JsonElement data = new JsonParser().parse(reader);
CompoundNBT nbt = NBTHelper.fromJson(data);
if (NBTHelper.deserialize(nbt, settings)) {
return settings;
}
} catch (IOException e) {
e.printStackTrace();
}
try (Writer writer = new BufferedWriter(new FileWriter(file))) {
CompoundNBT tag = NBTHelper.serializeCompact(settings);
JsonElement json = NBTHelper.toJson(tag);
GSON.toJson(json, writer);
} catch (IOException e) {
e.printStackTrace();
}
return settings;
}
public static void exportDefaults(TerraSettings settings) { public static void exportDefaults(TerraSettings settings) {
CompoundNBT tag = NBTHelper.serializeCompact(settings); CompoundNBT tag = NBTHelper.serializeCompact(settings);
JsonElement json = NBTHelper.toJson(tag); JsonElement json = NBTHelper.toJson(tag);
@ -51,18 +73,10 @@ public class SettingsHelper {
} }
public static TerraSettings readDefaults() { public static TerraSettings readDefaults() {
TerraSettings settings = new TerraSettings();
if (DEFAULTS_FILE.exists()) { if (DEFAULTS_FILE.exists()) {
try (Reader reader = new BufferedReader(new FileReader(DEFAULTS_FILE))) { return loadSettings(DEFAULTS_FILE);
Log.info("Loading generator settings from json");
JsonElement json = new JsonParser().parse(reader);
CompoundNBT root = NBTHelper.fromJson(json);
NBTHelper.deserialize(root, settings);
} catch (Throwable t) {
t.printStackTrace();
} }
} return new TerraSettings();
return settings;
} }
public static TerraSettings getSettings(WorldInfo info) { public static TerraSettings getSettings(WorldInfo info) {

View File

@ -53,11 +53,11 @@ public class StructureSettings {
public static class Structure { public static class Structure {
@Range(min = 1, max = 200) @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; public int distance;
@Range(min = 1, max = 50) @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 int separation;
public Structure() { public Structure() {

View File

@ -3,20 +3,16 @@ package com.terraforged.mod.chunk.settings.preset;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.terraforged.mod.Log; import com.terraforged.mod.Log;
import com.terraforged.mod.chunk.settings.SettingsHelper; import com.terraforged.mod.chunk.settings.SettingsHelper;
import com.terraforged.mod.chunk.settings.TerraSettings; import com.terraforged.mod.chunk.settings.TerraSettings;
import com.terraforged.mod.util.nbt.NBTHelper; import com.terraforged.mod.util.nbt.NBTHelper;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileReader;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.Reader;
import java.io.Writer; import java.io.Writer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -127,15 +123,8 @@ public class PresetManager implements Iterable<Preset> {
} }
String name = file.getName().substring(0, file.getName().length() - 5); String name = file.getName().substring(0, file.getName().length() - 5);
try (Reader reader = new BufferedReader(new FileReader(file))) { TerraSettings settings = SettingsHelper.loadSettings(file);
JsonElement data = new JsonParser().parse(reader);
CompoundNBT nbt = NBTHelper.fromJson(data);
TerraSettings settings = new TerraSettings();
NBTHelper.deserialize(nbt, settings);
presets.add(new Preset(name, file, settings)); presets.add(new Preset(name, file, settings));
} catch (IOException e) {
e.printStackTrace();
}
} }
return new PresetManager(presets); return new PresetManager(presets);

View File

@ -29,6 +29,7 @@ import com.terraforged.mod.biome.ModBiomes;
import com.terraforged.world.terrain.Terrain; import com.terraforged.world.terrain.Terrain;
import com.terraforged.world.terrain.Terrains; import com.terraforged.world.terrain.Terrains;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
public class Test { public class Test {
@ -43,6 +44,6 @@ public class Test {
} }
public static Biome getBiome() { public static Biome getBiome() {
return ModBiomes.ERODED_PINNACLE; return Biomes.OCEAN;
} }
} }

View File

@ -25,9 +25,9 @@
package com.terraforged.mod.chunk.test; package com.terraforged.mod.chunk.test;
import com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.biome.provider.TerraBiomeProvider;
import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.core.cell.Cell;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
public class TestBiomeProvider extends TerraBiomeProvider { public class TestBiomeProvider extends TerraBiomeProvider {

View File

@ -13,7 +13,6 @@ public class TestHeightMap extends Heightmap {
public TestHeightMap(GeneratorContext context) { public TestHeightMap(GeneratorContext context) {
super(context); super(context);
terrains = context.terrain; terrains = context.terrain;
System.out.println("TESTETETEST");
} }
@Override @Override

View File

@ -25,8 +25,9 @@ public class GuiKeys {
public static final TranslationKey PRESET_LOAD = TranslationKey.gui("preset.load", "Load"); public static final TranslationKey PRESET_LOAD = TranslationKey.gui("preset.load", "Load");
public static final TranslationKey PRESET_SAVE = TranslationKey.gui("preset.save", "Save"); public static final TranslationKey PRESET_SAVE = TranslationKey.gui("preset.save", "Save");
public static final TranslationKey PRESET_RESET = TranslationKey.gui("preset.reset", "Reset"); public static final TranslationKey PRESET_RESET = TranslationKey.gui("preset.reset", "Reset");
public static final TranslationKey PRESET_DEFAULT = TranslationKey.gui("preset.default", "Make Default");
public static final TranslationKey PRESET_DELETE = TranslationKey.gui("preset.delete", "Delete"); public static final TranslationKey PRESET_DELETE = TranslationKey.gui("preset.delete", "Delete");
public static final TranslationKey PRESET_SET_DEFAULTS = TranslationKey.gui("preset.default.set", "Make Defaults");
public static final TranslationKey PRESET_CLEAR_DEFAULTS = TranslationKey.gui("preset.default.reset", "Reset Defaults");
public static void init() { public static void init() {

View File

@ -112,7 +112,7 @@ public class SettingsScreen extends OverlayScreen {
for (Page page : pages) { for (Page page : pages) {
page.save(); page.save();
} }
parent.chunkProviderSettingsJson = NBTHelper.serializeCompact(instance.settings); parent.chunkProviderSettingsJson = NBTHelper.stripMetadata(instance.settingsData);
SettingsScreen.setSeed(parent, preview.getSeed()); SettingsScreen.setSeed(parent, preview.getSeed());
onClose(); onClose();
})); }));

View File

@ -0,0 +1,54 @@
package com.terraforged.mod.client.gui.element;
import com.terraforged.n2d.util.NoiseUtil;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.fml.client.gui.widget.Slider;
public class TerraBoundSlider extends TerraSlider.Float {
private final float pad;
private final String lower;
private final String upper;
public TerraBoundSlider(String name, CompoundNBT value) {
this(name, value, 0.005F);
}
public TerraBoundSlider(String name, CompoundNBT value, float pad) {
super(name, value);
CompoundNBT meta = value.getCompound("#" + name);
this.pad = pad;
this.lower = meta.getString("limit_lower");
this.upper = meta.getString("limit_upper");
}
@Override
protected void onChange(Slider slider, CompoundNBT value) {
int i = (int) (slider.getValue() * 1000);
float lower = getLower(value) + pad;
float upper = getUpper(value) - pad;
float val = NoiseUtil.clamp(i / 1000F, lower, upper);
// update setting value
value.putFloat(name, val);
// update actual slider value
setValue(val);
updateSlider();
}
private float getLower(CompoundNBT value) {
if (lower == null || lower.isEmpty()) {
return 0F;
}
return value.getFloat(lower);
}
private float getUpper(CompoundNBT value) {
if (upper == null || upper.isEmpty()) {
return 1F;
}
return value.getFloat(upper);
}
}

View File

@ -36,6 +36,7 @@ public abstract class TerraSlider extends Slider implements Slider.ISlider, Elem
private final CompoundNBT value; private final CompoundNBT value;
private final List<String> tooltip; private final List<String> tooltip;
private boolean lock = false;
private Runnable callback = () -> {}; private Runnable callback = () -> {};
public TerraSlider(String name, CompoundNBT value, boolean decimal) { public TerraSlider(String name, CompoundNBT value, boolean decimal) {
@ -58,7 +59,11 @@ public abstract class TerraSlider extends Slider implements Slider.ISlider, Elem
@Override @Override
public void onChangeSliderValue(Slider slider) { public void onChangeSliderValue(Slider slider) {
if (!lock) {
lock = true;
onChange(slider, value); onChange(slider, value);
lock = false;
}
} }
@Override @Override

View File

@ -34,6 +34,7 @@ import java.util.List;
public class TerraToggle extends TerraButton { public class TerraToggle extends TerraButton {
private final boolean noname;
private final String prefix; private final String prefix;
private final String name; private final String name;
private final CompoundNBT value; private final CompoundNBT value;
@ -50,6 +51,7 @@ public class TerraToggle extends TerraButton {
this.prefix = Element.getDisplayName(name, value) + ": "; this.prefix = Element.getDisplayName(name, value) + ": ";
this.tooltip = Element.getToolTip(name, value); this.tooltip = Element.getToolTip(name, value);
CompoundNBT meta = value.getCompound("#" + name); CompoundNBT meta = value.getCompound("#" + name);
this.noname = meta.contains("noname");
this.options = meta.getList("options", Constants.NBT.TAG_STRING); this.options = meta.getList("options", Constants.NBT.TAG_STRING);
for (int i = 0; i < options.size(); i++) { for (int i = 0; i < options.size(); i++) {
String s = options.getString(i); String s = options.getString(i);
@ -58,8 +60,13 @@ public class TerraToggle extends TerraButton {
break; break;
} }
} }
if (noname) {
setMessage(value.getString(name));
} else {
setMessage(prefix + value.getString(name)); setMessage(prefix + value.getString(name));
} }
}
public TerraToggle callback(Runnable runnable) { public TerraToggle callback(Runnable runnable) {
this.callback = runnable; this.callback = runnable;
@ -92,7 +99,11 @@ public class TerraToggle extends TerraButton {
} }
String option = options.getString(index); String option = options.getString(index);
value.putString(name, option); value.putString(name, option);
if (noname) {
setMessage(option);
} else {
setMessage(prefix + option); setMessage(prefix + option);
}
callback.run(); callback.run();
} }
} }

View File

@ -29,6 +29,7 @@ import com.terraforged.mod.client.gui.OverlayRenderer;
import com.terraforged.mod.client.gui.OverlayScreen; import com.terraforged.mod.client.gui.OverlayScreen;
import com.terraforged.mod.client.gui.ScrollPane; import com.terraforged.mod.client.gui.ScrollPane;
import com.terraforged.mod.client.gui.element.Element; import com.terraforged.mod.client.gui.element.Element;
import com.terraforged.mod.client.gui.element.TerraBoundSlider;
import com.terraforged.mod.client.gui.element.TerraLabel; import com.terraforged.mod.client.gui.element.TerraLabel;
import com.terraforged.mod.client.gui.element.TerraSlider; import com.terraforged.mod.client.gui.element.TerraSlider;
import com.terraforged.mod.client.gui.element.TerraTextInput; import com.terraforged.mod.client.gui.element.TerraTextInput;
@ -168,6 +169,8 @@ public abstract class Page implements IGuiEventListener, OverlayRenderer {
byte type = tag.getId(); byte type = tag.getId();
if (type == Constants.NBT.TAG_INT) { if (type == Constants.NBT.TAG_INT) {
return new TerraSlider.Int(name, value).callback(callback); return new TerraSlider.Int(name, value).callback(callback);
} else if (type == Constants.NBT.TAG_FLOAT && hasLimit(name, value)) {
return new TerraBoundSlider(name, value).callback(callback);
} else if (type == Constants.NBT.TAG_FLOAT) { } else if (type == Constants.NBT.TAG_FLOAT) {
return new TerraSlider.Float(name, value).callback(callback); return new TerraSlider.Float(name, value).callback(callback);
} else if (type == Constants.NBT.TAG_STRING && hasOptions(name, value)) { } else if (type == Constants.NBT.TAG_STRING && hasOptions(name, value)) {
@ -209,4 +212,8 @@ public abstract class Page implements IGuiEventListener, OverlayRenderer {
private static boolean hasOptions(String name, CompoundNBT value) { private static boolean hasOptions(String name, CompoundNBT value) {
return value.getCompound("#" + name).contains("options"); return value.getCompound("#" + name).contains("options");
} }
private static boolean hasLimit(String name, CompoundNBT value) {
return value.getCompound("#" + name).contains("limit_lower");
}
} }

View File

@ -156,25 +156,6 @@ public class PresetsPage extends BasePage {
} }
}); });
right.scrollPane.addButton(new TerraButton(GuiKeys.PRESET_DEFAULT.get()) {
@Override
public void render(int x, int z, float ticks) {
super.active = hasSelectedPreset();
super.render(x, z, ticks);
}
@Override
public void onClick(double x, double y) {
super.onClick(x, y);
getSelected().ifPresent(preset -> {
TerraSettings settings = preset.getSettings();
SettingsHelper.exportDefaults(settings);
});
}
});
right.scrollPane.addButton(new TerraButton(GuiKeys.PRESET_DELETE.get()) { right.scrollPane.addButton(new TerraButton(GuiKeys.PRESET_DELETE.get()) {
@Override @Override
@ -194,6 +175,30 @@ public class PresetsPage extends BasePage {
} }
}); });
right.scrollPane.addButton(new TerraButton(GuiKeys.PRESET_SET_DEFAULTS.get()) {
@Override
public void onClick(double x, double y) {
super.onClick(x, y);
Optional<Preset> selected = getSelected();
if (selected.isPresent()) {
SettingsHelper.exportDefaults(selected.get().getSettings());
} else {
SettingsHelper.exportDefaults(instance.createCopy());
}
}
});
right.scrollPane.addButton(new TerraButton(GuiKeys.PRESET_CLEAR_DEFAULTS.get()) {
@Override
public void onClick(double x, double y) {
super.onClick(x, y);
TerraSettings settings = new TerraSettings();
SettingsHelper.exportDefaults(settings);
}
});
right.scrollPane.addButton(previewWidget); right.scrollPane.addButton(previewWidget);
// used to pad the scroll-pane out so that the preview legend scrolls on larger gui scales // used to pad the scroll-pane out so that the preview legend scrolls on larger gui scales

View File

@ -70,6 +70,7 @@ public class WorldPage extends BasePage {
Column left = getColumn(0); Column left = getColumn(0);
addElements(left.left, left.top, left, worldSettings, true, left.scrollPane::addButton, this::update); addElements(left.left, left.top, left, worldSettings, true, left.scrollPane::addButton, this::update);
addElements(left.left, left.top, left, dimSettings, true, left.scrollPane::addButton, this::update); addElements(left.left, left.top, left, dimSettings, true, left.scrollPane::addButton, this::update);
} }

View File

@ -36,10 +36,11 @@ import com.terraforged.core.tile.Size;
import com.terraforged.core.tile.Tile; import com.terraforged.core.tile.Tile;
import com.terraforged.core.tile.gen.TileGenerator; import com.terraforged.core.tile.gen.TileGenerator;
import com.terraforged.mod.client.gui.GuiKeys; import com.terraforged.mod.client.gui.GuiKeys;
import com.terraforged.n2d.util.NoiseUtil;
import com.terraforged.mod.util.nbt.NBTHelper; import com.terraforged.mod.util.nbt.NBTHelper;
import com.terraforged.n2d.util.NoiseUtil;
import com.terraforged.world.GeneratorContext; import com.terraforged.world.GeneratorContext;
import com.terraforged.world.continent.MutableVeci; import com.terraforged.world.continent.MutableVeci;
import com.terraforged.world.continent.SpawnType;
import com.terraforged.world.heightmap.Levels; import com.terraforged.world.heightmap.Levels;
import com.terraforged.world.terrain.Terrains; import com.terraforged.world.terrain.Terrains;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -204,7 +205,9 @@ public class Preview extends Button {
GeneratorContext context = GeneratorContext.createNoCache(Terrains.create(settings), settings); GeneratorContext context = GeneratorContext.createNoCache(Terrains.create(settings), settings);
MutableVeci center = new MutableVeci(); MutableVeci center = new MutableVeci();
if (settings.world.properties.spawnType == SpawnType.CONTINENT_CENTER) {
context.factory.getHeightmap().getContinent().getNearestCenter(offsetX, offsetZ, center); context.factory.getHeightmap().getContinent().getNearestCenter(offsetX, offsetZ, center);
}
TileGenerator renderer = TileGenerator.builder() TileGenerator renderer = TileGenerator.builder()
.pool(threadPool) .pool(threadPool)
@ -290,12 +293,12 @@ public class Preview extends Button {
String terrain = cell.terrain.getName().toLowerCase(); String terrain = cell.terrain.getName().toLowerCase();
if (terrain.contains("ocean")) { if (terrain.contains("ocean")) {
if (cell.temperature < 0.3) { if (cell.temperature < 0.3) {
return "cold_ocean"; return "cold_" + terrain;
} }
if (cell.temperature > 0.6) { if (cell.temperature > 0.6) {
return "warm_ocean"; return "warm_" + terrain;
} }
return "ocean"; return terrain;
} }
if (terrain.contains("river")) { if (terrain.contains("river")) {
return "river"; return "river";

View File

@ -74,6 +74,7 @@ public class PreviewPage extends UpdatablePage {
preview.setHeight(Preview.HEIGHT); preview.setHeight(Preview.HEIGHT);
addElements(right.left, right.top, right, previewerSettings, right.scrollPane::addButton, this::update); addElements(right.left, right.top, right, previewerSettings, right.scrollPane::addButton, this::update);
right.scrollPane.addButton(new TerraButton(GuiKeys.PREVIEW_SEED.get()) { right.scrollPane.addButton(new TerraButton(GuiKeys.PREVIEW_SEED.get()) {
@Override @Override
public void onPress() { public void onPress() {

View File

@ -26,6 +26,7 @@
package com.terraforged.mod.client.gui.preview; package com.terraforged.mod.client.gui.preview;
import com.terraforged.core.serialization.annotation.Comment; 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.Range;
import com.terraforged.core.serialization.annotation.Serializable; import com.terraforged.core.serialization.annotation.Serializable;
@ -36,6 +37,7 @@ public class PreviewSettings {
@Comment("Controls the zoom level of the preview map") @Comment("Controls the zoom level of the preview map")
public int zoom = 100 - 32; public int zoom = 100 - 32;
@NoName
@Comment("Controls the rendering mode on the preview map") @Comment("Controls the rendering mode on the preview map")
public RenderMode display = RenderMode.BIOME_TYPE; public RenderMode display = RenderMode.BIOME_TYPE;
} }

View File

@ -40,6 +40,26 @@ public enum RenderMode {
return rgba(hsb[0], hsb[1], (hsb[2] * scale) + bias); return rgba(hsb[0], hsb[1], (hsb[2] * scale) + bias);
} }
}, },
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);
}
}
},
TEMPERATURE { TEMPERATURE {
@Override @Override
public int getColor(Cell cell, float scale, float bias) { public int getColor(Cell cell, float scale, float bias) {
@ -56,7 +76,7 @@ public enum RenderMode {
return rgba(step(cell.moisture, 8) * 0.65F, saturation, brightness); return rgba(step(cell.moisture, 8) * 0.65F, saturation, brightness);
} }
}, },
BIOME_SHAPE { BIOME {
@Override @Override
public int getColor(Cell cell, float scale, float bias) { public int getColor(Cell cell, float scale, float bias) {
float saturation = 0.7F; float saturation = 0.7F;
@ -64,7 +84,7 @@ public enum RenderMode {
return rgba(cell.biome, saturation, brightness); return rgba(cell.biome, saturation, brightness);
} }
}, },
MACRO_NOISE_SHAPE { MACRO_NOISE {
@Override @Override
public int getColor(Cell cell, float scale, float bias) { public int getColor(Cell cell, float scale, float bias) {
float saturation = 0.7F; float saturation = 0.7F;
@ -72,21 +92,23 @@ public enum RenderMode {
return rgba(cell.macroNoise, saturation, brightness); return rgba(cell.macroNoise, saturation, brightness);
} }
}, },
REGION_SHAPE { TERRAIN_REGION {
@Override @Override
public int getColor(Cell cell, float scale, float bias) { public int getColor(Cell cell, float scale, float bias) {
float saturation = 0.7F; float saturation = 0.7F;
float brightness = 0.8F; float brightness = 0.8F;
return rgba(cell.region, saturation, brightness); return rgba(cell.terrain.getHue(), saturation, brightness);
} }
}, },
; ;
public int getColor(Cell cell, Levels levels) { public int getColor(Cell cell, Levels levels) {
float baseHeight = levels.water; float baseHeight = levels.water;
if (this != TRANSITION_POINTS) {
if (cell.value < baseHeight) { if (cell.value < baseHeight) {
return rgba(40, 140, 200); return rgba(40, 140, 200);
} }
}
float bands = 10F; float bands = 10F;
float alpha = 0.2F; float alpha = 0.2F;
float elevation = (cell.value - baseHeight) / (1F - baseHeight); float elevation = (cell.value - baseHeight) / (1F - baseHeight);

View File

@ -1,13 +1,13 @@
package com.terraforged.mod.client.gui.preview2; package com.terraforged.mod.client.gui.preview2;
import com.mojang.blaze3d.systems.RenderSystem; 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.ThreadPool;
import com.terraforged.core.concurrent.thread.ThreadPools; import com.terraforged.core.concurrent.thread.ThreadPools;
import com.terraforged.core.render.RenderAPI; import com.terraforged.core.render.RenderAPI;
import com.terraforged.core.render.RenderSettings; import com.terraforged.core.render.RenderSettings;
import com.terraforged.core.render.RenderWorld; import com.terraforged.core.render.RenderWorld;
import com.terraforged.core.tile.gen.TileGenerator; import com.terraforged.core.tile.gen.TileGenerator;
import com.terraforged.mod.chunk.settings.TerraSettings;
import com.terraforged.world.GeneratorContext; import com.terraforged.world.GeneratorContext;
import com.terraforged.world.continent.MutableVeci; import com.terraforged.world.continent.MutableVeci;
import com.terraforged.world.continent.SpawnType; import com.terraforged.world.continent.SpawnType;
@ -117,6 +117,6 @@ public class Preview extends Widget {
renderSettings.zoom = previewSettings.getZoom(ZOOM_SCALE); renderSettings.zoom = previewSettings.getZoom(ZOOM_SCALE);
renderSettings.renderMode = previewSettings.display; renderSettings.renderMode = previewSettings.display;
return new RenderWorld(generator, renderAPI, renderSettings, regions, size); return new RenderWorld(threadPool, generator, renderAPI, renderSettings, regions, size);
} }
} }

View File

@ -1,6 +1,7 @@
package com.terraforged.mod.client.gui.preview2; package com.terraforged.mod.client.gui.preview2;
import com.terraforged.core.render.RenderMode; 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.Range;
import com.terraforged.core.serialization.annotation.Serializable; import com.terraforged.core.serialization.annotation.Serializable;
@ -10,6 +11,7 @@ public class PreviewSettings {
@Range(min = 1, max = 100) @Range(min = 1, max = 100)
public float zoom = 90F; public float zoom = 90F;
@NoName
public RenderMode display = RenderMode.BIOME_TYPE; public RenderMode display = RenderMode.BIOME_TYPE;
public float getZoom(float scale) { public float getZoom(float scale) {

View File

@ -1,8 +1,8 @@
package com.terraforged.mod.config; package com.terraforged.mod.config;
import com.electronwill.nightconfig.core.CommentedConfig; import com.electronwill.nightconfig.core.CommentedConfig;
import com.terraforged.mod.Log;
import com.terraforged.core.concurrent.thread.ThreadPools; import com.terraforged.core.concurrent.thread.ThreadPools;
import com.terraforged.mod.Log;
public class PerfDefaults { public class PerfDefaults {

View File

@ -40,6 +40,7 @@ public class DataGen {
public static void dumpData() { public static void dumpData() {
File dataDir = new File("data"); File dataDir = new File("data");
WorldGenBiomes.genBiomeMap(dataDir); WorldGenBiomes.genBiomeMap(dataDir);
WorldGenBiomes.genBiomeWeights(dataDir);
WorldGenBlocks.genBlockTags(dataDir); WorldGenBlocks.genBlockTags(dataDir);
WorldGenFeatures.genBiomeFeatures(dataDir); WorldGenFeatures.genBiomeFeatures(dataDir);
} }

View File

@ -1,7 +1,7 @@
package com.terraforged.mod.data; package com.terraforged.mod.data;
import com.terraforged.mod.chunk.settings.TerraSettings;
import com.terraforged.core.util.NameUtil; 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.GuiKeys;
import com.terraforged.mod.client.gui.preview2.PreviewSettings; import com.terraforged.mod.client.gui.preview2.PreviewSettings;
import com.terraforged.mod.util.TranslationKey; import com.terraforged.mod.util.TranslationKey;
@ -39,7 +39,7 @@ public class LangGenerator {
} }
private static void worlds(LanguageProvider provider) { private static void worlds(LanguageProvider provider) {
provider.add("generator.terraforged", "TerraForged"); provider.add("generator.terraforged", "JurisForged");
provider.add("generator.terratest", "TerraTest"); provider.add("generator.terratest", "TerraTest");
} }

View File

@ -28,6 +28,7 @@ package com.terraforged.mod.data;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.terraforged.mod.biome.map.BiomeMap; import com.terraforged.mod.biome.map.BiomeMap;
import com.terraforged.mod.biome.provider.BiomeHelper; import com.terraforged.mod.biome.provider.BiomeHelper;
import com.terraforged.mod.biome.provider.BiomeWeights;
import com.terraforged.world.biome.BiomeType; import com.terraforged.world.biome.BiomeType;
import net.minecraft.util.ResourceLocation; 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) { private static ResourceLocation getName(BiomeType type) {
return new ResourceLocation("terraforged", type.name().toLowerCase()); return new ResourceLocation("terraforged", type.name().toLowerCase());
} }

View File

@ -1,9 +1,9 @@
package com.terraforged.mod.feature; package com.terraforged.mod.feature;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.terraforged.mod.feature.sapling.SaplingConfig;
import com.terraforged.fm.data.DataManager; import com.terraforged.fm.data.DataManager;
import com.terraforged.fm.util.Json; import com.terraforged.fm.util.Json;
import com.terraforged.mod.feature.sapling.SaplingConfig;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import java.util.HashMap; import java.util.HashMap;

View File

@ -25,10 +25,10 @@
package com.terraforged.mod.feature; package com.terraforged.mod.feature;
import com.terraforged.mod.feature.feature.DiskFeature;
import com.terraforged.fm.matcher.BiomeFeatureMatcher; import com.terraforged.fm.matcher.BiomeFeatureMatcher;
import com.terraforged.fm.matcher.biome.BiomeMatcher; import com.terraforged.fm.matcher.biome.BiomeMatcher;
import com.terraforged.fm.matcher.feature.FeatureMatcher; import com.terraforged.fm.matcher.feature.FeatureMatcher;
import com.terraforged.mod.feature.feature.DiskFeature;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;

View File

@ -59,9 +59,15 @@ public class TerrainHelper {
); );
private final float radius; private final float radius;
private final float overhang;
private final float overhang2;
public TerrainHelper(float radius) { // base - the size of the base built up around a piece as a percentage of its bounding box size
this.radius = radius; // overhang - the amount of overhead overhang to be cut out
public TerrainHelper(float base, float cutout) {
this.radius = base;
this.overhang = cutout;
this.overhang2 = cutout * cutout;
} }
public void flatten(IWorld world, IChunk chunk) { public void flatten(IWorld world, IChunk chunk) {
@ -148,7 +154,22 @@ public class TerrainHelper {
if (highest != null) { if (highest != null) {
MutableBoundingBox bounds = highest.getBoundingBox(); MutableBoundingBox bounds = highest.getBoundingBox();
for (int dy = bounds.minY + highestOffset; dy <= surface; dy++) { int minY = bounds.minY + highestOffset;
int maxY = minY + bounds.getYSize();
if (maxY <= surface) {
// gets weaker the further from the center of the piece
float dist = getCenterDistance2(x, z, bounds);
float distAlpha = 1F - NoiseUtil.clamp(dist / overhang2, 0, 1);
// gets weaker the more material is overhead creating the inverse cutout (ie overhang)
float depth = surface - maxY;
float depthAlpha = 1F - NoiseUtil.clamp(depth / overhang, 0, 1);
maxY += NoiseUtil.round(depthAlpha * distAlpha * overhang);
}
for (int dy = minY; dy <= maxY; dy++) {
pos.setPos(dx, dy, dz); pos.setPos(dx, dy, dz);
chunk.setBlockState(pos, Blocks.AIR.getDefaultState(), false); chunk.setBlockState(pos, Blocks.AIR.getDefaultState(), false);
} }
@ -164,6 +185,14 @@ public class TerrainHelper {
return NoiseUtil.lerp(surface, level, alpha); return NoiseUtil.lerp(surface, level, alpha);
} }
private float getCenterDistance2(int x, int z, MutableBoundingBox bounds) {
float cx = bounds.minX + (bounds.getXSize() / 2F);
float cz = bounds.minZ + (bounds.getZSize() / 2F);
float dx = cx - x;
float dz = cz - z;
return dx * dx + dz * dz;
}
private static void collectPiece(StructurePiece structurepiece, List<StructurePiece> list) { private static void collectPiece(StructurePiece structurepiece, List<StructurePiece> list) {
if (structurepiece instanceof AbstractVillagePiece) { if (structurepiece instanceof AbstractVillagePiece) {
AbstractVillagePiece piece = (AbstractVillagePiece) structurepiece; AbstractVillagePiece piece = (AbstractVillagePiece) structurepiece;

View File

@ -1,12 +1,12 @@
package com.terraforged.mod.feature.context; 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.cell.Cell;
import com.terraforged.core.concurrent.Resource; import com.terraforged.core.concurrent.Resource;
import com.terraforged.core.concurrent.cache.SafeCloseable; import com.terraforged.core.concurrent.cache.SafeCloseable;
import com.terraforged.core.concurrent.pool.ObjectPool; import com.terraforged.core.concurrent.pool.ObjectPool;
import com.terraforged.core.tile.chunk.ChunkReader; 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 com.terraforged.world.heightmap.Levels;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;

View File

@ -1,8 +1,8 @@
package com.terraforged.mod.feature.decorator.poisson; package com.terraforged.mod.feature.decorator.poisson;
import com.terraforged.mod.chunk.TerraChunkGenerator;
import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Cell;
import com.terraforged.core.tile.chunk.ChunkReader; import com.terraforged.core.tile.chunk.ChunkReader;
import com.terraforged.mod.chunk.TerraChunkGenerator;
import com.terraforged.n2d.Module; import com.terraforged.n2d.Module;
import com.terraforged.n2d.Source; import com.terraforged.n2d.Source;
import com.terraforged.n2d.util.NoiseUtil; import com.terraforged.n2d.util.NoiseUtil;

View File

@ -2,10 +2,10 @@ package com.terraforged.mod.feature.sapling;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.terraforged.mod.feature.BlockDataConfig;
import com.terraforged.fm.template.TemplateManager; import com.terraforged.fm.template.TemplateManager;
import com.terraforged.fm.template.feature.TemplateFeatureConfig; import com.terraforged.fm.template.feature.TemplateFeatureConfig;
import com.terraforged.fm.util.Json; import com.terraforged.fm.util.Json;
import com.terraforged.mod.feature.BlockDataConfig;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;

View File

@ -25,13 +25,13 @@
package com.terraforged.mod.feature.sapling; 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.TerraWorld;
import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.TerraChunkGenerator;
import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.mod.feature.BlockDataManager; 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.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.Mirror; import net.minecraft.util.Mirror;

View File

@ -57,11 +57,16 @@ public class Materials {
public final Set<Block> clay = create(WGTags.CLAY, States.CLAY.getBlock()); public final Set<Block> clay = create(WGTags.CLAY, States.CLAY.getBlock());
public final Set<Block> sediment = create(WGTags.SEDIMENT, States.GRAVEL.getBlock()); public final Set<Block> sediment = create(WGTags.SEDIMENT, States.GRAVEL.getBlock());
public final Set<Block> erodible = create(WGTags.ERODIBLE, null); public final Set<Block> erodible = create(WGTags.ERODIBLE, null);
public final Set<Block> cold = create(WGTags.COLD, States.STONE.getBlock());
public LayerManager getLayerManager() { public LayerManager getLayerManager() {
return layerManager; return layerManager;
} }
public boolean isCold(Block block) {
return cold.contains(block);
}
public boolean isStone(Block block) { public boolean isStone(Block block) {
return stone.contains(block); return stone.contains(block);
} }

View File

@ -44,6 +44,7 @@ public class GeoGenerator implements StrataGenerator {
private final List<Block> soil; private final List<Block> soil;
private final List<Block> clay; private final List<Block> clay;
private final List<Block> sediment; private final List<Block> sediment;
private final List<Block> cold;
private final List<Source> types = new ArrayList<>(); private final List<Source> types = new ArrayList<>();
public GeoGenerator(Materials materials) { public GeoGenerator(Materials materials) {
@ -52,6 +53,7 @@ public class GeoGenerator implements StrataGenerator {
soil = Materials.toList(materials.dirt); soil = Materials.toList(materials.dirt);
clay = Materials.toList(materials.clay); clay = Materials.toList(materials.clay);
sediment = Materials.toList(materials.sediment); sediment = Materials.toList(materials.sediment);
cold = Materials.toList(materials.cold);
} }
@Override @Override
@ -62,6 +64,7 @@ public class GeoGenerator implements StrataGenerator {
addLayer(seed + 2, random, config.sediment, sediment, builder); addLayer(seed + 2, random, config.sediment, sediment, builder);
addLayer(seed + 3, random, config.clay, clay, builder); addLayer(seed + 3, random, config.clay, clay, builder);
addLayer(seed + 4, random, config.rock, rock, builder); addLayer(seed + 4, random, config.rock, rock, builder);
addLayer(seed + 5, random, config.cold, cold, builder);
return builder.build(); return builder.build();
} }

View File

@ -27,8 +27,8 @@ package com.terraforged.mod.material.geology;
import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.geology.GeologyManager;
import com.terraforged.api.material.geology.StrataConfig; import com.terraforged.api.material.geology.StrataConfig;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.core.Seed; import com.terraforged.core.Seed;
import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.mod.material.Materials; import com.terraforged.mod.material.Materials;
import com.terraforged.n2d.Module; import com.terraforged.n2d.Module;
import com.terraforged.n2d.Source; import com.terraforged.n2d.Source;

View File

@ -31,20 +31,20 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; 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.Log;
import com.terraforged.mod.biome.provider.TerraBiomeProvider; import com.terraforged.mod.biome.provider.TerraBiomeProvider;
import com.terraforged.mod.chunk.TerraChunkGenerator; import com.terraforged.mod.chunk.TerraChunkGenerator;
import com.terraforged.mod.chunk.TerraContext; import com.terraforged.mod.chunk.TerraContext;
import com.terraforged.mod.chunk.settings.SettingsHelper; 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.BiomeArgType;
import com.terraforged.mod.server.command.arg.TerrainArgType; import com.terraforged.mod.server.command.arg.TerrainArgType;
import com.terraforged.mod.server.command.search.BiomeSearchTask; import com.terraforged.mod.server.command.search.BiomeSearchTask;
import com.terraforged.mod.server.command.search.BothSearchTask; import com.terraforged.mod.server.command.search.BothSearchTask;
import com.terraforged.mod.server.command.search.Search; import com.terraforged.mod.server.command.search.Search;
import com.terraforged.mod.server.command.search.TerrainSearchTask; 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.WorldGenerator;
import com.terraforged.world.terrain.Terrain; import com.terraforged.world.terrain.Terrain;
import com.terraforged.world.terrain.Terrains; import com.terraforged.world.terrain.Terrains;
@ -132,7 +132,11 @@ public class TerraCommand {
try (Resource<Cell> cell = biomeProvider.lookupPos(pos.getX(), pos.getZ())) { try (Resource<Cell> cell = biomeProvider.lookupPos(pos.getX(), pos.getZ())) {
Biome biome = biomeProvider.getBiome(cell.get(), pos.getX(), pos.getZ()); Biome biome = biomeProvider.getBiome(cell.get(), pos.getX(), pos.getZ());
context.getSource().sendFeedback( context.getSource().sendFeedback(
new StringTextComponent("Terrain=" + cell.get().terrain.getName() + ", Biome=" + biome.getRegistryName()), new StringTextComponent(
"Terrain=" + cell.get().terrain.getName()
+ ", Biome=" + biome.getRegistryName()
+ ", BiomeType=" + cell.get().biomeType.name()
),
false false
); );
} }

View File

@ -1,7 +1,7 @@
package com.terraforged.mod.server.command.search; package com.terraforged.mod.server.command.search;
import com.terraforged.mod.biome.provider.TerraBiomeProvider;
import com.terraforged.core.cell.Cell; import com.terraforged.core.cell.Cell;
import com.terraforged.mod.biome.provider.TerraBiomeProvider;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.gen.ChunkGenerator;
@ -27,6 +27,9 @@ public class BiomeSearchTask extends ChunkGeneratorSearch {
@Override @Override
public boolean test(BlockPos pos) { public boolean test(BlockPos pos) {
biomeProvider.getWorldLookup().applyCell(cell, pos.getX(), pos.getZ()); biomeProvider.getWorldLookup().applyCell(cell, pos.getX(), pos.getZ());
return biomeProvider.getBiome(cell, pos.getX(), pos.getZ()) == biome; if (biomeProvider.getBiome(cell, pos.getX(), pos.getZ()) == biome) {
return biomeProvider.getBiome(pos.getX(), pos.getZ()) == biome;
}
return false;
} }
} }

View File

@ -114,12 +114,13 @@ public class NBTHelper {
return tag; return tag;
} }
public static void deserialize(CompoundNBT settings, Object object) { public static boolean deserialize(CompoundNBT settings, Object object) {
try { try {
NBTReader reader = new NBTReader(settings); NBTReader reader = new NBTReader(settings);
reader.writeTo(object); return reader.writeTo(object);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
return false;
} }
} }
} }

View File

@ -25,9 +25,9 @@
package com.terraforged.mod.util.setup; package com.terraforged.mod.util.setup;
import com.terraforged.mod.Log;
import com.terraforged.api.event.SetupEvent; import com.terraforged.api.event.SetupEvent;
import com.terraforged.core.Seed; import com.terraforged.core.Seed;
import com.terraforged.mod.Log;
import com.terraforged.n2d.Source; import com.terraforged.n2d.Source;
import com.terraforged.n2d.source.Builder; import com.terraforged.n2d.source.Builder;
import com.terraforged.world.geology.Strata; import com.terraforged.world.geology.Strata;

View File

@ -26,9 +26,9 @@
package com.terraforged.mod.util.setup; package com.terraforged.mod.util.setup;
import com.terraforged.api.biome.modifier.ModifierManager; 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.ColumnDecorator;
import com.terraforged.api.chunk.column.DecoratorManager; import com.terraforged.api.chunk.column.DecoratorManager;
import com.terraforged.api.biome.surface.SurfaceManager;
import com.terraforged.api.event.SetupEvent; import com.terraforged.api.event.SetupEvent;
import com.terraforged.api.material.geology.GeologyManager; import com.terraforged.api.material.geology.GeologyManager;
import com.terraforged.api.material.layer.LayerManager; import com.terraforged.api.material.layer.LayerManager;

View File

@ -2,14 +2,14 @@ modLoader="javafml"
loaderVersion="[31,)" loaderVersion="[31,)"
[[mods]] [[mods]]
modId="terraforged" modId="terraforged"
displayName="TerraForged" displayName="JurisForged"
version="${version}" version="${version}"
authors="dags" authors="dags,Juris_LLM"
credits="dags" credits="dags,Juris_LLM"
logoFile="terraforged.png" logoFile="terraforged.png"
displayURL="https://terraforged.com" displayURL="https://i15.nl"
issueTrackerURL="https://github.com/TerraForged/TerraForged/issues" issueTrackerURL="https://gitea.i15.nl/abelhooge/TerraForged/issues"
description=''' description='''
Description: Description:
A terrain generator attempting to create more immersive, inspiring worlds to explore and build in! A totally stolen terrain generator, but enforced with the power of smites!
''' '''

View File

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"minecraft:stone"
]
}

View File

@ -0,0 +1,46 @@
{
"biomes": [
"minecraft:*mountains",
"minecraft:mountains*"
],
"match": [
[
"minecraft:decorated",
"minecraft:grass"
]
],
"replace": {
"name": "minecraft:decorated",
"config": {
"feature": {
"name": "minecraft:random_patch",
"config": {
"state_provider": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "minecraft:grass"
}
},
"block_placer": {
"type": "minecraft:simple_block_placer"
},
"whitelist": [],
"blacklist": [],
"tries": 64,
"xspread": 7,
"yspread": 3,
"zspread": 7,
"can_replace": false,
"project": false,
"need_water": false
}
},
"decorator": {
"name": "minecraft:count_heightmap_double",
"config": {
"count": 3
}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 55 KiB