package ca.recrown.islandsurvivalcraft.world.generation.noise;

import java.util.Random;

import org.bukkit.util.noise.SimplexOctaveGenerator;

public class FractalOctaveGenerator {
    private final SimplexOctaveGenerator simplex;
    private final double amplitude = 0.5d;
    private final double frequency = 0.5d;
    private final double scale = 0.05D;

    public FractalOctaveGenerator(Random random) {
        simplex = new SimplexOctaveGenerator(random, 4);
        simplex.setScale(scale);
    }

    public double noise(int x, int y) {
        return 1d - Math.abs(simplex.noise(x, y, frequency, amplitude, true));
    }
}