Package org.spout.vanilla.world.generator.normal.biome

Examples of org.spout.vanilla.world.generator.normal.biome.NormalBiome


        double maxSum = 0;
        double minSum = 0;
        double weightSum = 0;
        for (int sx = -SMOOTH_SIZE; sx <= SMOOTH_SIZE; sx++) {
          for (int sz = -SMOOTH_SIZE; sz <= SMOOTH_SIZE; sz++) {
            final NormalBiome adjacent;
            if (xx + sx < 0 || zz + sz < 0
                || xx + sx >= sizeX || zz + sz >= sizeZ) {
              if (biomeCache.containsKey(x + xx + sx, z + zz + sz)) {
                adjacent = biomeCache.get(x + xx + sx, z + zz + sz);
              } else {
                adjacent = (NormalBiome) selector.pickBiome(x + xx + sx, y, z + zz + sz, seed);
                biomeCache.put(x + xx + sx, z + zz + sz, adjacent);
              }
            } else {
              adjacent = (NormalBiome) biomes.getBiome(xx + sx, y, zz + sz);
            }
            final double weight = GAUSSIAN_KERNEL[sx + SMOOTH_SIZE][sz + SMOOTH_SIZE];
            minSum += adjacent.getMinElevation() * weight;
            maxSum += adjacent.getMaxElevation() * weight;
            weightSum += weight;
          }
        }
        final double minElevation = minSum / weightSum;
        final double smoothHeight = (maxSum / weightSum - minElevation) / 2;
View Full Code Here

TOP

Related Classes of org.spout.vanilla.world.generator.normal.biome.NormalBiome

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.