use of org.spongepowered.api.world.biome.GroundCoverLayer in project SpongeCommon by SpongePowered.
the class MixinBiomeHills method buildPopulators.
@Override
public void buildPopulators(World world, SpongeBiomeGenerationSettings gensettings) {
super.buildPopulators(world, gensettings);
gensettings.getGroundCoverLayers().clear();
gensettings.getGroundCoverLayers().add(new GroundCoverLayer((stoneNoise) -> {
IBlockState result = Blocks.GRASS.getDefaultState();
if ((stoneNoise < -1.0D || stoneNoise > 2.0D) && this.type == BiomeHills.Type.MUTATED) {
result = Blocks.GRAVEL.getDefaultState();
} else if (stoneNoise > 1.0D && this.type != BiomeHills.Type.EXTRA_TREES) {
result = Blocks.STONE.getDefaultState();
}
return (BlockState) result;
}, SeededVariableAmount.fixed(1)));
gensettings.getGroundCoverLayers().add(new GroundCoverLayer((stoneNoise) -> {
IBlockState result = Blocks.DIRT.getDefaultState();
if ((stoneNoise < -1.0D || stoneNoise > 2.0D) && this.type == BiomeHills.Type.MUTATED) {
result = Blocks.GRAVEL.getDefaultState();
} else if (stoneNoise > 1.0D && this.type != BiomeHills.Type.EXTRA_TREES) {
result = Blocks.STONE.getDefaultState();
}
return (BlockState) result;
}, WorldGenConstants.GROUND_COVER_DEPTH));
BiomeDecorator theBiomeDecorator = this.decorator;
RandomBlock emerald = RandomBlock.builder().block((BlockState) Blocks.EMERALD_ORE.getDefaultState()).placementTarget(WorldGenConstants.STONE_LOCATION).perChunk(VariableAmount.baseWithRandomAddition(3, 6)).height(VariableAmount.baseWithRandomAddition(4, 28)).build();
gensettings.getPopulators().add(emerald);
Ore silverfish = Ore.builder().ore((BlockState) Blocks.MONSTER_EGG.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE)).perChunk(7).height(VariableAmount.baseWithRandomAddition(0, 64)).size(9).build();
gensettings.getPopulators().add(silverfish);
gensettings.getPopulators().removeAll(gensettings.getPopulators(Forest.class));
Forest.Builder forest = Forest.builder();
forest.perChunk(VariableAmount.baseWithOptionalAddition(theBiomeDecorator.treesPerChunk, 1, 0.1));
forest.type(BiomeTreeTypes.TALL_TAIGA.getPopulatorObject(), 20);
forest.type(BiomeTreeTypes.OAK.getPopulatorObject(), 9);
forest.type(BiomeTreeTypes.OAK.getLargePopulatorObject().get(), 1);
gensettings.getPopulators().add(0, forest.build());
}
use of org.spongepowered.api.world.biome.GroundCoverLayer in project SpongeCommon by SpongePowered.
the class SpongeBiomeGenerationSettingsBuilder method groundCover.
@Override
public Builder groundCover(GroundCoverLayer... coverLayers) {
checkNotNull(coverLayers, "coverLayers");
this.groundCover.clear();
for (GroundCoverLayer layer : coverLayers) {
this.groundCover.add(checkNotNull(layer, "layer"));
}
return this;
}
use of org.spongepowered.api.world.biome.GroundCoverLayer in project LanternServer by LanternPowered.
the class LanternBiomeGenerationSettingsBuilder method groundCover.
@Override
public Builder groundCover(Iterable<GroundCoverLayer> coverLayers) {
checkNotNull(coverLayers, "coverLayers");
this.groundCover.clear();
for (GroundCoverLayer layer : coverLayers) {
this.groundCover.add(checkNotNull(layer, "layer"));
}
return this;
}
Aggregations