Package com.khorn.terraincontrol.configuration

Examples of com.khorn.terraincontrol.configuration.WorldConfig


        }

        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);
        long l1 = this.rand.nextLong() / 2L * 2L + 1L;
        long l2 = this.rand.nextLong() / 2L * 2L + 1L;
        this.rand.setSeed(chunkCoord.getChunkX() * l1 + chunkCoord.getChunkZ() * l2 ^ resourcesSeed);
View Full Code Here


     */
    protected void calculateBiomeModes(Iterable<? extends LocalWorld> worlds)
    {
        for (LocalWorld world : worlds)
        {
            WorldConfig config = world.getConfigs().getWorldConfig();
            if (config != null)
            {
                Class<? extends BiomeGenerator> clazz = config.biomeMode;
                if (clazz.equals(NormalBiomeGenerator.class))
                {
View Full Code Here

        this.noiseGen6 = new NoiseGeneratorPerlinOctaves(this.random, 16);

        this.caveGen = new CavesGen(configs.getWorldConfig(), this.localWorld);
        this.canyonGen = new CanyonsGen(configs.getWorldConfig(), this.localWorld);

        WorldConfig worldConfig = configs.getWorldConfig();

        // Contains 2d array maxSmoothDiameter*maxSmoothDiameter.
        // Maximum weight is in array center.

        this.maxSmoothDiameter = worldConfig.maxSmoothRadius * 2 + 1;
View Full Code Here

        boolean dry = addBiomeBlocksAndCheckWater(chunkBuffer);

        this.caveGen.generate(chunkBuffer);
        this.canyonGen.generate(chunkBuffer);

        WorldConfig worldConfig = configProvider.getWorldConfig();
        if (worldConfig.ModeTerrain == WorldConfig.TerrainMode.Normal
                || worldConfig.ModeTerrain == WorldConfig.TerrainMode.OldGenerator)
        {
            this.localWorld.prepareDefaultStructures(x, z, dry);
        }
View Full Code Here

        final int oneEightOfHeight = this.heightCap / 8;

        final int maxYSections = this.heightCap / 8 + 1;
        final int usedYSections = this.heightScale / 8 + 1;

        WorldConfig worldConfig = configProvider.getWorldConfig();
        BiomeGenerator biomeGenerator = this.localWorld.getBiomeGenerator();
        if (worldConfig.improvedRivers)
            this.riverArray = biomeGenerator.getBiomesUnZoomed(this.riverArray, chunkX * 4 - maxSmoothRadius,
                    chunkZ * 4 - maxSmoothRadius, NOISE_MAX_X + maxSmoothDiameter, NOISE_MAX_Z + maxSmoothDiameter, OutputType.ONLY_RIVERS);

View Full Code Here

     *         villages will be placed.
     */
    protected boolean addBiomeBlocksAndCheckWater(ChunkBuffer chunkBuffer)
    {
        ChunkCoordinate chunkCoord = chunkBuffer.getChunkCoordinate();
        WorldConfig worldConfig = configProvider.getWorldConfig();
        int dryBlocksOnSurface = 256;

        final double d1 = 0.03125D;
        this.noise4 = this.noiseGen4.a(this.noise4, chunkCoord.getBlockX(), chunkCoord.getBlockZ(), CHUNK_X_SIZE, CHUNK_Z_SIZE, d1 * 2.0D,
                d1 * 2.0D, 1.0D);

        for (int x = 0; x < CHUNK_X_SIZE; x++)
        {
            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)
                {
                    // Moved one block lower to fix lighting issues
                    chunkBuffer.setBlock(x, this.heightCap - 2, z, worldConfig.bedrockBlock);
                }

                // Loop from map height to zero to place bedrock and surface
                // blocks
                LocalMaterialData currentSurfaceBlock = biomeConfig.surfaceBlock;
                LocalMaterialData currentGroundBlock = biomeConfig.groundBlock;
                int surfaceBlocksCount = -1;
                final int currentWaterLevel = this.waterLevel[z + x * 16];
                for (int y = CHUNK_Y_SIZE - 1; y >= 0; y--)
                {
                    if (y < 5 && (worldConfig.createAdminium(y)) && y <= this.random.nextInt(5))
                    {
                        // Place bottom bedrock
                        chunkBuffer.setBlock(x, y, z, worldConfig.bedrockBlock);
                    } else
                    {
View Full Code Here

        if (this.rawTerrain == null || this.rawTerrain.length != NOISE_MAX_X * maxYSections * NOISE_MAX_Z)
        {
            this.rawTerrain = new double[NOISE_MAX_X * maxYSections * NOISE_MAX_Z];
        }

        WorldConfig worldConfig = configProvider.getWorldConfig();
        final double xzScale = 684.41200000000003D * worldConfig.getFractureHorizontal();
        final double yScale = 684.41200000000003D * worldConfig.getFractureVertical();

        if (worldConfig.oldTerrainGenerator)
        {
            this.noise5 = this.noiseGen5.Noise2D(this.noise5, xOffset, zOffset, NOISE_MAX_X, NOISE_MAX_Z, 1.121D, 1.121D);
        }
View Full Code Here

        if ((paramArrayOfBiomeBase == null) || (paramArrayOfBiomeBase.length < xSize * zSize))
        {
            paramArrayOfBiomeBase = new int[xSize * zSize];
        }

        WorldConfig worldConfig = world.getConfigs().getWorldConfig();
        this.oldTemperature1 = this.temperatureGenerator1.a(this.oldTemperature1, x, z, xSize, xSize, 0.025000000372529D / worldConfig.oldBiomeSize, 0.025000000372529D / worldConfig.oldBiomeSize, 0.25D);
        this.oldWetness = this.wetnessGenerator.a(this.oldWetness, x, z, xSize, xSize, 0.0500000007450581D / worldConfig.oldBiomeSize, 0.0500000007450581D / worldConfig.oldBiomeSize, 0.3333333333333333D);
        this.oldTemperature2 = this.temperatureGenerator2.a(this.oldTemperature2, x, z, xSize, xSize, 0.25D / worldConfig.oldBiomeSize, 0.25D / worldConfig.oldBiomeSize, 0.5882352941176471D);

        int i = 0;
View Full Code Here

    public boolean spawnAsTree(LocalWorld world, Random random, int x, int z)
    {
        // Pick one object, try to spawn that, if that fails, try with another
        // object, as long as the objectSpawnRatio cap isn't reached.

        WorldConfig worldConfig = world.getConfigs().getWorldConfig();
        CustomObjectCollection customObjects = world.getConfigs().getCustomObjects();

        if (customObjects.isEmpty())
            return false;
View Full Code Here

    public boolean process(LocalWorld world, Random rand, ChunkCoordinate chunkCoord)
    {
        // Pick one object, try to spawn that, if that fails, try with another
        // object, as long as the objectSpawnRatio cap isn't reached.

        WorldConfig worldConfig = world.getConfigs().getWorldConfig();
        CustomObjectCollection customObjects = world.getConfigs().getCustomObjects();

        if (customObjects.isEmpty())
            return false;
View Full Code Here

TOP

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

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.