use of net.minecraft.world.gen.structure.MapGenStructure in project SpongeCommon by SpongePowered.
the class MixinChunkGeneratorFlat method addPopulators.
@Override
public void addPopulators(WorldGenerator generator) {
for (Object o : this.structureGenerators.values()) {
if (o instanceof MapGenBase) {
generator.getGenerationPopulators().add((GenerationPopulator) o);
if (o instanceof MapGenStructure) {
generator.getPopulators().add((Populator) o);
}
}
}
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) {
Lake lake = Lake.builder().chance(1 / 4d).liquidType((BlockState) Blocks.WATER.getDefaultState()).height(VariableAmount.baseWithRandomAddition(0, 256)).build();
FilteredPopulator filtered = new FilteredPopulator(lake);
filtered.setRequiredFlags(WorldGenConstants.VILLAGE_FLAG);
generator.getPopulators().add(lake);
}
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) {
Lake lake = Lake.builder().chance(1 / 8d).liquidType((BlockState) Blocks.WATER.getDefaultState()).height(VariableAmount.baseWithVariance(0, VariableAmount.baseWithRandomAddition(8, VariableAmount.baseWithOptionalAddition(55, 193, 0.1)))).build();
FilteredPopulator filtered = new FilteredPopulator(lake);
filtered.setRequiredFlags(WorldGenConstants.VILLAGE_FLAG);
generator.getPopulators().add(filtered);
}
if (this.hasDungeons) {
Dungeon dungeon = Dungeon.builder().attempts(8).build();
generator.getPopulators().add(dungeon);
}
for (BiomeType type : Sponge.getRegistry().getAllOf(BiomeType.class)) {
BiomeGenerationSettings settings = generator.getBiomeSettings(type);
settings.getGroundCoverLayers().clear();
if (!this.hasDecoration) {
settings.getPopulators().clear();
settings.getGenerationPopulators().clear();
}
}
}
Aggregations