Skip to content

Commit

Permalink
Add biome generation in Modern Beta.
Browse files Browse the repository at this point in the history
* Update Biolith to 1.2.0-beta.1 for Modern Beta support
- Allow Traverse biomes to generate in Modern Beta worlds
  • Loading branch information
gniftygnome committed Jan 12, 2024
1 parent 5a8ebe6 commit 736550e
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
includeMod "terraform-api", "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraform_wood_api_version}"

if (findProject(':traverse-worldgen') != null) {
includeMod "biolith", "com.terraformersmc:biolith:${biolith_version}"
includeMod "biolith", "com.terraformersmc:biolith-fabric:${biolith_version}"
}

afterEvaluate {
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ fabric.loom.multiProjectOptimisation=true
maven_group=com.terraformersmc
archive_name=traverse

minecraft_version=1.20.3
yarn_mappings=1.20.3+build.1
loader_version=0.15.1
minecraft_version=23w51b
yarn_mappings=23w51b+build.4
loader_version=0.15.3
fabric_version=0.93.1+1.20.5
terraform_biome_remapper_api_version=9.0.0
terraform_config_api_version=9.0.0
terraform_surfaces_api_version=9.0.0
terraform_tree_api_version=9.0.0
terraform_wood_api_version=9.0.0
fabric_version=0.91.1+1.20.3

# Biolith for worldgen module and testing
biolith_version=1.1.0-beta.1
biolith_version=1.2.0-beta.1

# TerraBlender for worldgen module and testing
terrablender_version=1.20.3-3.3.0.2
terrablender_version=1.20.4-3.3.0.5

# Project Metadata
project_name=Traverse
Expand All @@ -31,14 +31,14 @@ default_release_type=alpha
# CurseForge Metadata
curseforge_slug=traverse
curseforge_id=308777
curseforge_game_versions=1.20.3, 1.20.4, Fabric, Quilt
curseforge_game_versions=1.20.5-Snapshot, Fabric, Quilt
curseforge_required_dependencies=fabric-api
curseforge_optional_dependencies=

# Modrinth Metadata
modrinth_slug=traverse
modrinth_id=kXygSBVI
modrinth_game_versions=1.20.3, 1.20.4
modrinth_game_versions=23w51b
modrinth_mod_loaders=fabric, quilt
modrinth_required_dependencies=fabric-api
#modrinth_embedded_dependencies=biolith
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"depends": {
"fabricloader": ">=0.15",
"fabric-api": ">=0.77.0",
"minecraft": ">=1.20.3 <1.21",
"minecraft": ">=1.20.4 <1.21",
"java": ">=17"
},
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion worldgen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ loom {

dependencies {
// Biolith and TerraBlender for the worldgen API modules
modImplementation "com.terraformersmc:biolith:${biolith_version}"
modImplementation "com.terraformersmc:biolith-fabric:${biolith_version}"
modCompileOnlyApi "com.github.glitchfiend:TerraBlender-fabric:${terrablender_version}"

implementation project(path: ':traverse-common')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.terraformersmc.traverse.biomegen;

import com.terraformersmc.biolith.api.biome.BiomePlacement;
import com.terraformersmc.biolith.api.compat.BiolithCompats;
import com.terraformersmc.biolith.api.compat.ModernBetaBiomeKeys;
import com.terraformersmc.biolith.api.surface.SurfaceGeneration;
import com.terraformersmc.traverse.Traverse;
import com.terraformersmc.traverse.config.TraverseBiomeConfig;
Expand All @@ -21,6 +23,56 @@ public void addBiomes() {
if (BIOME_CONFIG.isBiomeEnabled(LUSH_SWAMP)) { BiomePlacement.replaceOverworld(BiomeKeys.SWAMP, LUSH_SWAMP, 0.2D); }
if (BIOME_CONFIG.isBiomeEnabled(SNOWY_CONIFEROUS_FOREST)) { BiomePlacement.replaceOverworld(BiomeKeys.SNOWY_TAIGA, SNOWY_CONIFEROUS_FOREST, 0.2D); }
if (BIOME_CONFIG.isBiomeEnabled(WOODLANDS)) { BiomePlacement.replaceOverworld(BiomeKeys.BIRCH_FOREST, WOODLANDS, 0.2D); }

// Target some Modern Beta biomes for replacement by ours.
if (BiolithCompats.isCompatEnabled(BiolithCompats.MODERN_BETA)) {
if (BIOME_CONFIG.isBiomeEnabled(AUTUMNAL_WOODS)) {
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_420, AUTUMNAL_WOODS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_611, AUTUMNAL_WOODS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.ALPHA, AUTUMNAL_WOODS, 0.4D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_SKY, AUTUMNAL_WOODS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_SEASONAL_FOREST, AUTUMNAL_WOODS, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.PE_SEASONAL_FOREST, AUTUMNAL_WOODS, 0.2D);
}
if (BIOME_CONFIG.isBiomeEnabled(CONIFEROUS_FOREST)) {
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_611, CONIFEROUS_FOREST, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.ALPHA, CONIFEROUS_FOREST, 0.4D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_TAIGA, CONIFEROUS_FOREST, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.PE_TAIGA, CONIFEROUS_FOREST, 0.2D);
}
if (BIOME_CONFIG.isBiomeEnabled(DESERT_SHRUBLAND)) {
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_DESERT, DESERT_SHRUBLAND, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.PE_DESERT, DESERT_SHRUBLAND, 0.3D);
}
if (BIOME_CONFIG.isBiomeEnabled(FLATLANDS)) {
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_227, FLATLANDS, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_415, FLATLANDS, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_420, FLATLANDS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_611, FLATLANDS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.ALPHA, FLATLANDS, 0.4D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_SKY, FLATLANDS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_PLAINS, FLATLANDS, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.PE_PLAINS, FLATLANDS, 0.2D);
}
if (BIOME_CONFIG.isBiomeEnabled(LUSH_SWAMP)) {
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_SWAMPLAND, LUSH_SWAMP, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.PE_SWAMPLAND, LUSH_SWAMP, 0.3D);
}
if (BIOME_CONFIG.isBiomeEnabled(SNOWY_CONIFEROUS_FOREST)) {
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.ALPHA_WINTER, SNOWY_CONIFEROUS_FOREST, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_TUNDRA, SNOWY_CONIFEROUS_FOREST, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.PE_TUNDRA, SNOWY_CONIFEROUS_FOREST, 0.2D);
}
if (BIOME_CONFIG.isBiomeEnabled(WOODLANDS)) {
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_415, WOODLANDS, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_420, WOODLANDS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.INFDEV_611, WOODLANDS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.ALPHA, WOODLANDS, 0.4D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_SKY, WOODLANDS, 0.3D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.BETA_FOREST, WOODLANDS, 0.2D);
BiomePlacement.replaceOverworld(ModernBetaBiomeKeys.PE_FOREST, WOODLANDS, 0.2D);
}
}
}

// Use Biolith to register our Biome placements.
Expand Down
2 changes: 1 addition & 1 deletion worldgen/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
}
},
"depends": {
"biolith": "*"
"biolith": ">=1.2.0-beta.1"
}
}

0 comments on commit 736550e

Please sign in to comment.