Package com.khorn.terraincontrol.configuration

Examples of com.khorn.terraincontrol.configuration.BiomeConfig


        SettingsReader settingsReader = new MemorySettingsReader("Test");
        StandardBiomeTemplate biomeTemplate = new StandardBiomeTemplate(TerrainControl.WORLD_HEIGHT);
        BiomeLoadInstruction loadInstruction = new BiomeLoadInstruction("Test", 0, biomeTemplate);

        // We can't create a WorldConfig object, so just pass a null parameter
        return new BiomeConfig(settingsReader, loadInstruction, null);
    }
View Full Code Here


    @Test
    public void testEmptyChildList()
    {
        // If the child list is empty, all resources in the parent list must
        // be copied to the child.
        BiomeConfig config = createBiomeConfig();

        List<Resource> parentList = Arrays.asList(
                Resource.createResource(config, DungeonGen.class, 4, 100, 10, 30),
                Resource.createResource(config, DungeonGen.class, 1, 50, 30, 60)
                );
View Full Code Here

    @Test
    public void testOverrides()
    {
        // The resource in the parent list shouldn't be added to the child
        // list, as the child already got a similar resource
        BiomeConfig config = createBiomeConfig();

        List<Resource> parentList = Arrays.asList(
                Resource.createResource(config, DungeonGen.class, 4, 100, 10, 30));

        List<Resource> childList = Arrays.asList(
View Full Code Here

        {
            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

                // 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

    {
        // 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())
View Full Code Here

                        {
                            double d16 = d11;
                            final double d17 = (d12 - d11) * oneFourth;
                            for (int piece_z = 0; piece_z < 4; piece_z++)
                            {
                                final BiomeConfig biomeConfig = toBiomeConfig(this.biomeArray[(z * 4 + piece_z) * 16 + (piece_x + x * 4)]);
                                final int waterLevelMax = this.waterLevel[(z * 4 + piece_z) * 16 + (piece_x + x * 4)] & 0xFF;
                                LocalMaterialData block = air;
                                if (y * 8 + piece_y < waterLevelMax && y * 8 + piece_y > biomeConfig.waterLevelMin)
                                {
                                    block = biomeConfig.waterBlock;
View Full Code Here

            for (int z = 0; z < CHUNK_Z_SIZE; z++)
            {
                // The following code is executed for each column in the chunk

                // Get the current biome config and some properties
                final BiomeConfig biomeConfig = this.configProvider.getBiomeByIdOrNull(this.biomeArray[(x + z * CHUNK_X_SIZE)]).getBiomeConfig();
                final float currentTemperature = biomeConfig.biomeTemperature;
                final int surfaceBlocksNoise = (int) (this.noise4[(x + z * CHUNK_X_SIZE)] / 3.0D + 3.0D + this.random.nextDouble() * 0.25D);

                // Bedrock on the ceiling
                if (worldConfig.ceilingBedrock)
View Full Code Here

            for (int z = 0; z < NOISE_MAX_Z; z++)
            {

                final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius)
                        * (NOISE_MAX_X + this.maxSmoothDiameter))];
                final BiomeConfig biomeConfig = this.configProvider.getBiomeByIdOrNull(biomeId).getBiomeConfig();

                double noiseHeight = this.noise6[i2D] / 8000.0D;
                if (noiseHeight < 0.0D)
                {
                    noiseHeight = -noiseHeight * 0.3D;
 
View Full Code Here

            int index = z * 48 + 17 + x * 3;
            double product = oldBiomeGenerator.oldTemperature1[index] * oldBiomeGenerator.oldWetness[index];
            this.volatilityFactor = 1.0 - product;
        } else
        {
            final BiomeConfig biomeConfig = toBiomeConfig(this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius)
                    * (NOISE_MAX_X + this.maxSmoothDiameter))]);
            this.volatilityFactor = (1.0D - Math.min(1, biomeConfig.biomeTemperature) * biomeConfig.biomeWetness);
        }
        this.volatilityFactor *= this.volatilityFactor;
        this.volatilityFactor = 1.0D - this.volatilityFactor * this.volatilityFactor;
 
View Full Code Here

TOP

Related Classes of com.khorn.terraincontrol.configuration.BiomeConfig

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.