From 1467738e38505675743371400c039723aa76c874 Mon Sep 17 00:00:00 2001 From: gniftygnome Date: Fri, 5 Aug 2022 12:59:22 -0700 Subject: [PATCH] Fix some bugs in the new biome config. --- .../traverse/config/TraverseBiomeConfig.java | 9 +++++++-- .../biomegen/TraverseTerraBlenderGeneration.java | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/terraformersmc/traverse/config/TraverseBiomeConfig.java b/common/src/main/java/com/terraformersmc/traverse/config/TraverseBiomeConfig.java index a9ede77..807455c 100644 --- a/common/src/main/java/com/terraformersmc/traverse/config/TraverseBiomeConfig.java +++ b/common/src/main/java/com/terraformersmc/traverse/config/TraverseBiomeConfig.java @@ -9,10 +9,15 @@ import java.util.stream.Collectors; public class TraverseBiomeConfig { - private final Map biomes = TraverseBiomes.BIOMES.keySet().stream().collect(Collectors.toMap(k -> k.getValue().getPath(), k -> true)); + private final Map biomes; + + TraverseBiomeConfig() { + // This is where to set biomes to default disabled if needed (replace "k -> true"). + biomes = TraverseBiomes.BIOMES.keySet().stream().collect(Collectors.toMap(k -> k.getValue().getPath(), k -> true)); + } public boolean isBiomeEnabled(String name) { - return biomes.get(name); + return !biomes.containsKey(name) || biomes.get(name); } public boolean isBiomeEnabled(Identifier identifier) { diff --git a/worldgen/src/main/java/com/terraformersmc/traverse/biomegen/TraverseTerraBlenderGeneration.java b/worldgen/src/main/java/com/terraformersmc/traverse/biomegen/TraverseTerraBlenderGeneration.java index da81a57..70a8953 100644 --- a/worldgen/src/main/java/com/terraformersmc/traverse/biomegen/TraverseTerraBlenderGeneration.java +++ b/worldgen/src/main/java/com/terraformersmc/traverse/biomegen/TraverseTerraBlenderGeneration.java @@ -17,7 +17,7 @@ import static com.terraformersmc.traverse.biome.TraverseBiomes.*; public class TraverseTerraBlenderGeneration extends Region implements Runnable, TerraBlenderApi { - TraverseBiomeConfig BIOME_CONFIG = Traverse.getConfigManager().getBiomeConfig(); + TraverseBiomeConfig BIOME_CONFIG; public TraverseTerraBlenderGeneration() { super(new Identifier(Traverse.MOD_ID, "overworld"), RegionType.OVERWORLD, 5); @@ -53,6 +53,7 @@ public void run() { SurfaceRuleManager.addSurfaceRules(SurfaceRuleManager.RuleCategory.OVERWORLD, Traverse.MOD_ID, TraverseSurfaceRules.createRules()); // Add the biomes to Overworld generation via TerraBlender. + BIOME_CONFIG = Traverse.getConfigManager().getBiomeConfig(); Regions.register(this); } }