All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pepsoft.worldpainter.NoiseChunkFactory Maven / Gradle / Ivy

There is a newer version: 2.23.2
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.pepsoft.worldpainter;

import org.pepsoft.minecraft.HeightMapChunkFactory;
import org.pepsoft.util.PerlinNoise;
import static org.pepsoft.worldpainter.Constants.*;

/**
 *
 * @author pepijn
 */
public class NoiseChunkFactory extends HeightMapChunkFactory {
    public NoiseChunkFactory(int maxHeight, int version) {
        super(maxHeight, version);
    }
    
    @Override
    protected int getHeight(int x, int z) {
        return (int) Math.round(perlinNoise.getPerlinNoise(x / LARGE_BLOBS, z / LARGE_BLOBS) * RANGE + 36);
    }

    private final PerlinNoise perlinNoise = new PerlinNoise(System.currentTimeMillis());

    public static final double RANGE = 20;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy