com.parzivail.util.gen.terrain.CanyonTerrainBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pswg Show documentation
Show all versions of pswg Show documentation
Explore the galaxy with Galaxies: Parzi's Star Wars Mod!
package com.parzivail.util.gen.terrain;
import com.parzivail.util.gen.noise.OctaveNoise;
import java.util.Random;
import net.minecraft.class_3532;
public class CanyonTerrainBuilder extends TerrainBuilder
{
private final OctaveNoise noise;
// private final OctaveNoise wx;
// private final OctaveNoise wz;
private final OctaveNoise noiseMini;
public CanyonTerrainBuilder()
{
long seed = 100;
this.noise = new OctaveNoise(3, new Random(seed), 64.0, 16.0, 1.0, 2.0, 2.0);
// this.wz = new OctaveNoise(1, new Random(seed), 64.0, 16.0, 1.0, 2.0, 2.0);
// this.noise = new OctaveNoise(1, new Random(seed), 64.0, 16.0, 1.0, 2.0, 2.0);
this.noiseMini = new OctaveNoise(2, new Random(seed), 8.0, 8.0, 1.0, 2.0, 2.0);
}
@Override
public double build(int x, int y, int z)
{
double wx = Math.abs(noise.sample(x, 0, z));
if (wx > 0.08)
{
wx *= 6; // TODO: noise!
}
wx = class_3532.method_15350(wx, 0, 1);
// TODO: add a bit of variance
return (-y + 9) + (wx * 4.5) + (noiseMini.sample(x, y, z) * 0.35);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy