diff --git a/src/main/java/org/betterx/bclib/api/v2/generator/BCLChunkGenerator.java b/src/main/java/org/betterx/bclib/api/v2/generator/BCLChunkGenerator.java index 235184bf..a553c0ee 100644 --- a/src/main/java/org/betterx/bclib/api/v2/generator/BCLChunkGenerator.java +++ b/src/main/java/org/betterx/bclib/api/v2/generator/BCLChunkGenerator.java @@ -76,26 +76,31 @@ public class BCLChunkGenerator extends NoiseBasedChunkGenerator { //terrablender is completley invalidating the feature imitialization //we redo it at this point, otherwise we will get blank biomes - if (this instanceof ChunkGeneratorAccessor acc) { - Function, BiomeGenerationSettings> function = (Holder hh) -> hh.value() - .getGenerationSettings(); - - acc.bcl_setFeaturesPerStep(Suppliers.memoize(() -> FeatureSorter.buildFeaturesPerStep( - List.copyOf(biomeSource.possibleBiomes()), - (hh) -> function.apply(hh).features(), - true - ))); - } + rebuildFeaturesPerStep(biomeSource); } System.out.println("Chunk Generator: " + this + " (biomeSource: " + biomeSource + ")"); } + private void rebuildFeaturesPerStep(BiomeSource biomeSource) { + if (this instanceof ChunkGeneratorAccessor acc) { + Function, BiomeGenerationSettings> function = (Holder hh) -> hh.value() + .getGenerationSettings(); + + acc.bcl_setFeaturesPerStep(Suppliers.memoize(() -> FeatureSorter.buildFeaturesPerStep( + List.copyOf(biomeSource.possibleBiomes()), + (hh) -> function.apply(hh).features(), + true + ))); + } + } + public void restoreInitialBiomeSource() { if (initialBiomeSource != getBiomeSource()) { if (this instanceof ChunkGeneratorAccessor acc) { BiomeSource bs = LevelGenUtil.getWorldSettings() .fixBiomeSource(initialBiomeSource, getBiomeSource().possibleBiomes()); acc.bcl_setBiomeSource(bs); + rebuildFeaturesPerStep(getBiomeSource()); } } }