Examples of CoreBiome


Examples of org.terasology.core.world.CoreBiome

        TreeFacet facet = chunkRegion.getFacet(TreeFacet.class);
        BiomeFacet biomeFacet = chunkRegion.getFacet(BiomeFacet.class);

        for (Vector3i pos : facet.getRelativeRegion()) {
            float facetValue = facet.get(pos);
            CoreBiome biome = biomeFacet.get(pos.x, pos.z);
            if (facetValue > 0) {
                for (TreeGenerator generator : treeGeneratorLookup.get(biome)) {
                    if (generator.getGenerationProbability() > (facetValue / 256f)) {
                        generator.generate(chunk, new FastRandom((long) facetValue), pos.x, pos.y, pos.z);
                        break;
View Full Code Here

Examples of org.terasology.core.world.CoreBiome

        SurfaceHeightFacet surfaceFacet = chunkRegion.getFacet(SurfaceHeightFacet.class);
        BiomeFacet biomeFacet = chunkRegion.getFacet(BiomeFacet.class);
        Vector2i pos2d = new Vector2i();
        for (Vector3i pos : ChunkConstants.CHUNK_REGION) {
            pos2d.set(pos.x, pos.z);
            CoreBiome biome = biomeFacet.get(pos2d);
            chunk.setBiome(pos.x, pos.y, pos.z, biome);

            float density = solidityFacet.get(pos);
            if (density >= 32) {
                chunk.setBlock(pos, stone);
View Full Code Here

Examples of org.terasology.core.world.CoreBiome

        int maxY = facet.getWorldRegion().maxY();
        for (int z = facet.getRelativeRegion().minZ(); z <= facet.getRelativeRegion().maxZ(); ++z) {
            for (int x = facet.getRelativeRegion().minX(); x <= facet.getRelativeRegion().maxX(); ++x) {
                int height = TeraMath.floorToInt(surface.get(x, z));
                if (height >= minY && height < maxY) {
                    CoreBiome biome = biomeFacet.get(x, z);
                    height = height - minY + facet.getRelativeRegion().minY();

                    if ((biome == CoreBiome.FOREST || biome == CoreBiome.PLAINS) && density.get(x, height, z) > 0
                            && density.get(x, height + 1, z) <= 0 && noiseTable.noise(x, z) < configuration.density) {
                        facet.set(x, height + 1, z, true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.