Search in sources :

Example 6 with SeaLevelFacet

use of org.terasology.world.generation.facets.SeaLevelFacet in project Terasology by MovingBlocks.

the class DefaultFloraProvider method getFilters.

protected List<Predicate<Vector3i>> getFilters(GeneratingRegion region) {
    List<Predicate<Vector3i>> filters = Lists.newArrayList();
    SeaLevelFacet seaLevel = region.getRegionFacet(SeaLevelFacet.class);
    filters.add(PositionFilters.minHeight(seaLevel.getSeaLevel()));
    filters.add(PositionFilters.probability(densityNoiseGen, configuration.density));
    return filters;
}
Also used : SeaLevelFacet(org.terasology.world.generation.facets.SeaLevelFacet) Predicate(com.google.common.base.Predicate)

Example 7 with SeaLevelFacet

use of org.terasology.world.generation.facets.SeaLevelFacet in project Terasology by MovingBlocks.

the class SeaLevelProvider method process.

@Override
public void process(GeneratingRegion region) {
    Border3D border = region.getBorderForFacet(SeaLevelFacet.class);
    SeaLevelFacet facet = new SeaLevelFacet(region.getRegion(), border);
    facet.setSeaLevel(seaLevel);
    region.setRegionFacet(SeaLevelFacet.class, facet);
}
Also used : Border3D(org.terasology.world.generation.Border3D) SeaLevelFacet(org.terasology.world.generation.facets.SeaLevelFacet)

Aggregations

SeaLevelFacet (org.terasology.world.generation.facets.SeaLevelFacet)7 SurfaceHeightFacet (org.terasology.world.generation.facets.SurfaceHeightFacet)5 Border3D (org.terasology.world.generation.Border3D)3 Predicate (com.google.common.base.Predicate)2 BiomeFacet (org.terasology.core.world.generator.facets.BiomeFacet)2 BaseVector2i (org.terasology.math.geom.BaseVector2i)2 Vector3i (org.terasology.math.geom.Vector3i)2 CoreBiome (org.terasology.core.world.CoreBiome)1 Region3i (org.terasology.math.Region3i)1 Rect2i (org.terasology.math.geom.Rect2i)1 SpiralIterable (org.terasology.math.geom.SpiralIterable)1 Vector2i (org.terasology.math.geom.Vector2i)1 Vector3f (org.terasology.math.geom.Vector3f)1 Biome (org.terasology.world.biomes.Biome)1 Block (org.terasology.world.block.Block)1 Region (org.terasology.world.generation.Region)1 DensityFacet (org.terasology.world.generation.facets.DensityFacet)1 SurfaceDepthFacet (org.terasology.world.generation.facets.SurfaceDepthFacet)1 SurfaceHumidityFacet (org.terasology.world.generation.facets.SurfaceHumidityFacet)1 SurfaceTemperatureFacet (org.terasology.world.generation.facets.SurfaceTemperatureFacet)1