Package org.terasology.world.biomes

Examples of org.terasology.world.biomes.Biome


            logger.debug("Received block change to {}", blockManager.getBlock((short) biomeChange.getNewBiome()));
            // TODO: Store changes to blocks that aren't ready to be modified (the surrounding chunks aren't available)
            WorldProvider worldProvider = CoreRegistry.get(WorldProvider.class);
            Vector3i pos = NetMessageUtil.convert(biomeChange.getPos());
            if (worldProvider.isBlockRelevant(pos)) {
                Biome newBiome = biomeManager.getBiomeByShortId((short) biomeChange.getNewBiome());
                worldProvider.setBiome(pos, newBiome);
            } else {
                awaitingChunkReadyBiomeUpdates.put(TeraMath.calcChunkPos(pos), biomeChange);
            }
        }
View Full Code Here


        }

        List<NetData.BiomeChangeMessage> updateBiomeMessages = awaitingChunkReadyBiomeUpdates.removeAll(chunkPos);
        for (NetData.BiomeChangeMessage message : updateBiomeMessages) {
            Vector3i pos = NetMessageUtil.convert(message.getPos());
            Biome newBiome = biomeManager.getBiomeByShortId((short) message.getNewBiome());
            worldProvider.setBiome(pos, newBiome);
        }
    }
View Full Code Here

    }

    private void renderBlockParticles(Vector3f worldPos, Vector3f cameraPosition, BlockParticleEffectComponent particleEffect) {

        Vector3i worldPos3i = new Vector3i(worldPos, 0.5f);
        Biome biome = worldProvider.getBiome(worldPos3i);

        glPushMatrix();
        glTranslated(worldPos.x - cameraPosition.x, worldPos.y - cameraPosition.y, worldPos.z - cameraPosition.z);

        for (Particle particle : particleEffect.particles) {
View Full Code Here

        final Stopwatch watch = Stopwatch.createStarted();

        for (int x = 0; x < ChunkConstants.SIZE_X; x++) {
            for (int z = 0; z < ChunkConstants.SIZE_Z; z++) {
                for (int y = verticalOffset; y < verticalOffset + meshHeight; y++) {
                    Biome biome = chunkView.getBiome(x, y, z);

                    Block block = chunkView.getBlock(x, y, z);
                    if (block != null && !block.isInvisible()) {
                        generateBlockVertices(chunkView, mesh, x, y, z, biome);
                    }
View Full Code Here

        return result;
    }

    @Override
    public Biome setBiome(Vector3i pos, Biome biome) {
        Biome oldBiome = biomes.put(pos, biome);
        if (oldBiome == null) {
            return defaultBiome;
        }
        return oldBiome;
    }
View Full Code Here

        return oldBiome;
    }

    @Override
    public Biome getBiome(Vector3i pos) {
        Biome result = biomes.get(pos);
        if (result == null) {
            return defaultBiome;
        }
        return result;
    }
View Full Code Here

        Vector3i chunkPos = TeraMath.calcChunkPos(worldPos);
        CoreChunk chunk = chunkProvider.getChunk(chunkPos);
        if (chunk != null) {
            Vector3i blockPos = TeraMath.calcBlockPos(worldPos);
            chunk.lock();
            Biome oldBiomeType = chunk.setBiome(blockPos.x, blockPos.y, blockPos.z, biome);
            chunk.unlock();
            if (oldBiomeType != biome) {
                BiomeChange oldChange = biomeChanges.get(worldPos);
                if (oldChange == null) {
                    biomeChanges.put(worldPos, new BiomeChange(worldPos, oldBiomeType, biome));
View Full Code Here

                @Override
                public String get() {
                    String biomeId = "unavailable";
                    Vector3i blockPos = new Vector3i(localPlayer.getPosition());
                    if (worldProvider.isBlockRelevant(blockPos)) {
                        Biome biome = worldProvider.getBiome(blockPos);
                        biomeId = CoreRegistry.get(BiomeManager.class).getBiomeId(biome);
                    }
                    return String.format("total vus: %s | worldTime: %.3f | biome: %s",
                            ChunkTessellator.getVertexArrayUpdateCount(),
                            worldProvider.getTime().getDays() - 0.0005f,    // use floor instead of rounding up
View Full Code Here

TOP

Related Classes of org.terasology.world.biomes.Biome

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.