Examples of LocalBiome


Examples of com.khorn.terraincontrol.LocalBiome

        // Get the corner block coords
        int x = chunkCoord.getChunkX() * 16;
        int z = chunkCoord.getChunkZ() * 16;

        // Get the biome of the other corner
        LocalBiome biome = world.getBiome(x + 15, z + 15);

        // Null check
        if (biome == null)
        {
            TerrainControl.log(LogMarker.DEBUG, "Unknown biome at {},{}  (chunk {}). Population failed.", x + 15, z + 15, chunkCoord);
            return;
        }

        BiomeConfig biomeConfig = biome.getBiomeConfig();

        // Get the random generator
        WorldConfig worldConfig = configProvider.getWorldConfig();
        long resourcesSeed = worldConfig.resourcesSeed != 0L ? worldConfig.resourcesSeed : world.getSeed();
        this.rand.setSeed(resourcesSeed);
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

            for (int j = 0; j < ChunkCoordinate.CHUNK_Z_SIZE; j++)
            {
                int blockToReplaceX = x + i;
                int blockToReplaceZ = z + j;
                // Using the calculated biome id so that ReplaceToBiomeName can't mess up the ids
                LocalBiome biome = this.world.getBiome(blockToReplaceX, blockToReplaceZ);
                if (biome != null)
                {
                    double noise = this.reusableChunkNoiseArray[i + j * 16];
                    BiomeConfig biomeConfig = biome.getBiomeConfig();
                    biomeConfig.surfaceAndGroundControl.spawn(world, biomeConfig, noise, blockToReplaceX, blockToReplaceZ);
                }
            }
        }
    }
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

    }

    protected void freezeColumn(int x, int z, LocalMaterialData snowMaterial)
    {
        // Using the calculated biome id so that ReplaceToBiomeName can't mess up the ids
        LocalBiome biome = world.getBiome(x, z);
        if (biome != null)
        {
            BiomeConfig biomeConfig = biome.getBiomeConfig();
            int blockToFreezeY = world.getHighestBlockYAt(x, z);
            if (blockToFreezeY > 0 && biome.getTemperatureAt(x, blockToFreezeY, z) < WorldStandardValues.SNOW_AND_ICE_MAX_TEMP)
            {
                // Ice has to be placed one block in the world
                if (world.getMaterial(x, blockToFreezeY - 1, z).isLiquid())
                {
                    world.setBlock(x, blockToFreezeY - 1, z, biomeConfig.iceBlock);
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

    {
        this.bordersFrom[replaceFrom] = new boolean[world.getMaxBiomesCount()];

        for (int i = 0; i < this.bordersFrom[replaceFrom].length; i++)
        {
            LocalBiome biome = world.getBiomeByIdOrNull(i);
            this.bordersFrom[replaceFrom][i] = biome == null || !replaceTo.getBiomeConfig().notBorderNear.contains(biome.getName());
        }
        this.bordersTo[replaceFrom] = replaceTo.getIds().getGenerationId();
    }
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

        this.configs = configs;
        this.riverBiomes = new int[world.getMaxBiomesCount()];

        for (int id = 0; id < this.riverBiomes.length; id++)
        {
            LocalBiome biome = configs.getBiomeByIdOrNull(id);

            if (biome == null || biome.getBiomeConfig().riverBiome.isEmpty())
                this.riverBiomes[id] = -1;
            else
                this.riverBiomes[id] = world.getBiomeByName(biome.getBiomeConfig().riverBiome).getIds().getGenerationId();

        }
    }
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

                if ((currentPiece & BiomeBits) == 0)    // without biome
                {
                    if (this.biomes.length > 0 && (currentPiece & IceBit) == 0) // Normal Biome
                    {
                        LocalBiome biome = this.biomes[nextInt(this.biomes.length)];
                        if (biome != null)
                            currentPiece |= biome.getIds().getGenerationId();
                    } else if (this.ice_biomes.length > 0 && (currentPiece & IceBit) != 0) //Ice biome
                    {
                        LocalBiome biome = this.ice_biomes[nextInt(this.ice_biomes.length)];
                        if (biome != null)
                            currentPiece |= biome.getIds().getGenerationId();
                    }
                }
                thisInts[(j + i * xSize)] = currentPiece;
            }
        }
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

            for (int local_x = m; local_x < n; local_x++)
            {
                double d9 = (local_x + generatingChunk.getBlockX() + 0.5D - x) / d3;
                for (int local_z = i3; local_z < i4; local_z++)
                {
                    LocalBiome biome = this.world.getBiome(local_x + generatingChunk.getBlockX(), local_z + generatingChunk.getBlockZ());
                    double d10 = (local_z + generatingChunk.getBlockZ() + 0.5D - z) / d3;

                    boolean grassFound = false;
                    if (d9 * d9 + d10 * d10 < 1.0D)
                    {
                        for (int local_y = i2; local_y > i1; local_y--)
                        {
                            double d11 = ((local_y - 1) + 0.5D - y) / d4;
                            if ((d11 > -0.7D) && (d9 * d9 + d11 * d11 + d10 * d10 < 1.0D))
                            {
                                LocalMaterialData material = generatingChunkBuffer.getBlock(local_x, local_y, local_z);
                                LocalMaterialData materialAbove = generatingChunkBuffer.getBlock(local_x, local_y + 1, local_z);
                                if (material.isMaterial(DefaultMaterial.GRASS) || material.isMaterial(DefaultMaterial.MYCEL))
                                    grassFound = true;
                                if (this.isSuitableBlock(material, materialAbove, biome))
                                {
                                    if (local_y - 1 < 10)
                                    {
                                        generatingChunkBuffer.setBlock(local_x, local_y, local_z, lava);
                                    } else
                                    {
                                        generatingChunkBuffer.setBlock(local_x, local_y, local_z, air);

                                        // Replace supporting sand with
                                        // sandstone. TODO: support red
                                        // sand(stone) in Minecraft 1.8
                                        if (materialAbove.isMaterial(DefaultMaterial.SAND) && materialAbove.getBlockData() == 0)
                                        {
                                            generatingChunkBuffer.setBlock(local_x, local_y + 1, local_z, sandstone);
                                        }

                                        // If grass was just deleted, try to
                                        // move it down
                                        if (grassFound
                                                && (generatingChunkBuffer.getBlock(local_x, local_y - 1, local_z)
                                                        .isMaterial(DefaultMaterial.DIRT)))
                                        {
                                            generatingChunkBuffer.setBlock(local_x, local_y - 1, local_z,
                                                    biome.getBiomeConfig().surfaceBlock);
                                        }
                                    }
                                }
                            }
                        }
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

            for (int localZ = k; localZ < m; localZ++)
            {
                double d9 = (localZ + generatingChunk.getBlockX() + 0.5D - paramDouble1) / d3;
                for (int localX = i2; localX < i3; localX++)
                {
                    LocalBiome biome = world.getBiome(localX + generatingChunk.getBlockX(), localZ + generatingChunk.getBlockZ());
                    BiomeConfig biomeConfig = biome.getBiomeConfig();
                    double d10 = (localX + generatingChunk.getBlockZ() + 0.5D - paramDouble3) / d3;
                    boolean grassFound = false;
                    if (d9 * d9 + d10 * d10 < 1.0D)
                    {
                        for (int localY = minY; localY >= maxY; localY--)
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

        this.riverLayer = riverLayer;
        this.riverBiomes = new int[world.getMaxBiomesCount()];

        for (int id = 0; id < this.riverBiomes.length; id++)
        {
            LocalBiome biome = configs.getBiomeByIdOrNull(id);

            if (biome == null || biome.getBiomeConfig().riverBiome.isEmpty())
                this.riverBiomes[id] = -1;
            else
                this.riverBiomes[id] = world.getBiomeByName(biome.getBiomeConfig().riverBiome).getIds().getGenerationId();

        }
    }
View Full Code Here

Examples of com.khorn.terraincontrol.LocalBiome

                        biomeConfig.getName(), savedId);
                continue;
            }

            // Create biome
            LocalBiome biome = world.createBiomeFor(biomeConfig, new BiomeIds(generationId, savedId));
            this.biomes[biome.getIds().getGenerationId()] = biome;

            // If not virtual, add to saved biomes set
            if (!biome.getIds().isVirtual())
            {
                savedBiomes.add(biome);
            }

            // Indexing ReplacedBlocks
            if (!this.worldConfig.BiomeConfigsHaveReplacement)
            {
                this.worldConfig.BiomeConfigsHaveReplacement = biomeConfig.replacedBlocks.hasReplaceSettings();
            }

            // Indexing BiomeRarity
            if (this.worldConfig.NormalBiomes.contains(biomeConfig.getName()))
            {
                this.worldConfig.normalBiomesRarity += biomeConfig.biomeRarity;
            }
            if (this.worldConfig.IceBiomes.contains(biomeConfig.getName()))
            {
                this.worldConfig.iceBiomesRarity += biomeConfig.biomeRarity;
            }

            // Indexing MaxSmoothRadius
            if (this.worldConfig.maxSmoothRadius < biomeConfig.smoothRadius)
            {
                this.worldConfig.maxSmoothRadius = biomeConfig.smoothRadius;
            }

            // Indexing BiomeColor
            if (this.worldConfig.biomeMode == TerrainControl.getBiomeModeManager().FROM_IMAGE)
            {
                if (this.worldConfig.biomeColorMap == null)
                {
                    this.worldConfig.biomeColorMap = new HashMap<Integer, Integer>();
                }

                int color = biomeConfig.biomeColor;
                this.worldConfig.biomeColorMap.put(color, biome.getIds().getGenerationId());
            }

            // Setting effects
            biome.setEffects();
        }

        if (this.biomesCount > 0)
        {
            // Remove last ", "
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.