Examples of BiomeSelector


Examples of org.spout.api.generator.biome.BiomeSelector

    final Vector3f size = blockData.getSize();
    final int sizeX = size.getFloorX();
    final int sizeY = size.getFloorY();
    final int sizeZ = size.getFloorZ();
    final double[][][] noise = WorldGeneratorUtils.fastNoise(NOISE, sizeX, sizeY, sizeZ, 4, x, y, z);
    final BiomeSelector selector = getSelector();
    final TIntPairObjectHashMap<NormalBiome> biomeCache = new TIntPairObjectHashMap<NormalBiome>();
    for (int xx = 0; xx < sizeX; xx++) {
      for (int zz = 0; zz < sizeZ; zz++) {
        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);
            }
View Full Code Here

Examples of org.spout.api.generator.biome.BiomeSelector

  }

  @Override
  public Point getSafeSpawn(World world) {
    short shift = 0;
    final BiomeSelector selector = getSelector();
    final long seed = world.getSeed();
    while (LogicUtil.equalsAny(selector.pickBiome(shift, 0, seed),
        VanillaBiomes.OCEAN, VanillaBiomes.BEACH, VanillaBiomes.RIVER,
        VanillaBiomes.SWAMP, VanillaBiomes.MUSHROOM_SHORE, VanillaBiomes.MUSHROOM)
        && shift < 1600) {
      shift += 16;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.