コード例 #1
0
  @Override
  public int findGroundY(WorldGenerator generator, int blockX, int blockZ) {

    // calculator the way down there bits
    double terrainAt = terrainShape.noise(blockX * terrainScale, blockZ * terrainScale) * midRange;
    double noiseAt = noiseShape.noise(blockX * noiseScale, blockZ * noiseScale) * noiseRange;
    return NoiseGenerator.floor(terrainAt + noiseAt) + midPoint;
  }
コード例 #2
0
  private int genGroundNoise(final int x, final int z, final int xchunk, final int zchunk) {
    final double x_calc = ((x + xchunk * 16) + Integer.MAX_VALUE / 2) * 0.003d;
    final double z_calc = ((z + zchunk * 16) + Integer.MAX_VALUE / 2) * 0.003d;

    final double temp = n_p.noise_FractionalBrownianMotion(x_calc, z_calc, 0, 6, 0.45f, 1.5f);
    final double ground = ground_nouise.noise(x_calc, z_calc, 4, 0.25, 0.125) * 33;
    final double cliff = cliffs.get((x + xchunk * 16) / 250.0f, (z + zchunk * 16) / 250.0f) * 120;

    double noise =
        ground
            + (Math.abs(
                    (n_p.noise_RidgedMultiFractal(x_calc, z_calc, 0, 4, 2.85f, 0.45f, 1.0f))
                        + (.05f * temp))
                * 55);
    noise = noise - cliff;

    return (int) Math.round(noise);
  }