diff --git a/src/main/java/biomesoplenty/api/enums/BOPClimates.java b/src/main/java/biomesoplenty/api/enums/BOPClimates.java index 8954f0356..399c38cda 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPClimates.java +++ b/src/main/java/biomesoplenty/api/enums/BOPClimates.java @@ -7,6 +7,8 @@ ******************************************************************************/ package biomesoplenty.api.enums; +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.init.ModBiomes; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; @@ -193,6 +195,7 @@ public enum BOPClimates set.addAll(climate.getIslandBiomes().stream().map(weightedBiomeEntry -> weightedBiomeEntry.biome).collect(Collectors.toSet())); } + ModBiomes.subBiomes.values().forEach(weightedSubBiome -> set.add(weightedSubBiome.biome)); return ImmutableSet.copyOf(set); } diff --git a/src/main/java/biomesoplenty/common/world/BOPBiomeProvider.java b/src/main/java/biomesoplenty/common/world/BOPBiomeProvider.java index 8a6735bcf..69968d0f1 100644 --- a/src/main/java/biomesoplenty/common/world/BOPBiomeProvider.java +++ b/src/main/java/biomesoplenty/common/world/BOPBiomeProvider.java @@ -29,13 +29,16 @@ import java.util.Random; import java.util.Set; import java.util.stream.Collectors; -public class BOPBiomeProvider extends BiomeProvider +public class BOPBiomeProvider extends OverworldBiomeProvider { private final Layer noiseBiomeLayer; + protected final Set possibleBiomes; public BOPBiomeProvider(OverworldBiomeProviderSettings settingsProvider) { - super(BOPClimates.getOverworldBiomes()); + super(settingsProvider); + this.possibleBiomes = Sets.newHashSet(super.possibleBiomes); + this.possibleBiomes.addAll(BOPClimates.getOverworldBiomes()); this.noiseBiomeLayer = BOPLayerUtil.createGenLayers(settingsProvider.getSeed(), settingsProvider.getGeneratorType(), settingsProvider.getGeneratorSettings())[0]; } @@ -44,4 +47,24 @@ public class BOPBiomeProvider extends BiomeProvider { return this.noiseBiomeLayer.get(x, z); } + + @Override + public boolean canGenerateStructure(Structure structure) + { + return this.supportedStructures.computeIfAbsent(structure, (p_226839_1_) -> this.possibleBiomes.stream().anyMatch((biome) -> biome.isValidStart(p_226839_1_))); + } + + @Override + public Set getSurfaceBlocks() + { + if (this.surfaceBlocks.isEmpty()) + { + for(Biome biome : this.possibleBiomes) + { + this.surfaceBlocks.add(biome.getSurfaceBuilderConfig().getTopMaterial()); + } + } + + return this.surfaceBlocks; + } } \ No newline at end of file