Package org.terasology.world.generation

Examples of org.terasology.world.generation.World


        return getSafeSpawnPosition(new Vector3i(ChunkConstants.SIZE_X / 2, ChunkConstants.SIZE_Y / 2, ChunkConstants.SIZE_Z / 2));
    }

    private Vector3i getSafeSpawnPosition(Vector3i spawnPos) {

        World world = worldGenerator.getWorld();
        if (world != null) {
            // try and find somewhere in this chunk a spot to land
            Region worldRegion = world.getWorldData(Region3i.createFromMinAndSize(new Vector3i(0, 0, 0), ChunkConstants.CHUNK_SIZE));
            SurfaceHeightFacet surfaceHeightFacet = worldRegion.getFacet(SurfaceHeightFacet.class);
            SeaLevelFacet seaLevelFacet = worldRegion.getFacet(SeaLevelFacet.class);
            int seaLevel = seaLevelFacet.getSeaLevel();

            for (Vector3i pos : ChunkConstants.CHUNK_REGION) {
View Full Code Here

TOP

Related Classes of org.terasology.world.generation.World

Copyright © 2018 www.massapicom. 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.