use of org.terasology.world.generation.WorldFacet in project Terasology by MovingBlocks.
the class LayeredZoneRegionFunctionTest method setup.
@Before
public void setup() {
parent.addZone(new Zone("Medium sky", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), MEDIUM_SKY))).addZone(new Zone("Low sky", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), LOW_SKY))).addZone(new Zone("Above ground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), ABOVE_GROUND))).addZone(new Zone("Ground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), GROUND))).addZone(new Zone("Shallow underground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), SHALLOW_UNDERGROUND))).addZone(new Zone("Medium underground", new LayeredZoneRegionFunction(new MinMaxLayerThickness(100, 100), MEDIUM_UNDERGROUND)));
parent.setSeed(12345);
parent.initialize();
ListMultimap<Class<? extends WorldFacet>, FacetProvider> facetProviderChains = ArrayListMultimap.create();
facetProviderChains.put(SurfaceHeightFacet.class, (generatingRegion) -> {
SurfaceHeightFacet facet = new SurfaceHeightFacet(generatingRegion.getRegion(), generatingRegion.getBorderForFacet(SurfaceHeightFacet.class));
for (BaseVector2i pos : facet.getRelativeRegion().contents()) {
facet.set(pos, 100);
}
generatingRegion.setRegionFacet(SurfaceHeightFacet.class, facet);
});
Map<Class<? extends WorldFacet>, Border3D> borders = new HashMap<>();
borders.put(SurfaceHeightFacet.class, new Border3D(0, 0, 0));
region = new RegionImpl(Region3i.createFromCenterExtents(new Vector3i(0, 0, 0), 4), facetProviderChains, borders);
}
Aggregations