Skip to content

Commit

Permalink
Fix some bugs in the new biome config.
Browse files Browse the repository at this point in the history
  • Loading branch information
gniftygnome committed Aug 5, 2022
1 parent 01f4805 commit 1467738
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
import java.util.stream.Collectors;

public class TraverseBiomeConfig {
private final Map<String, Boolean> biomes = TraverseBiomes.BIOMES.keySet().stream().collect(Collectors.toMap(k -> k.getValue().getPath(), k -> true));
private final Map<String, Boolean> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 1467738

Please sign in to comment.