Beispiel #1
0
  @Override
  public void generate(CuboidShortBuffer blockData, int chunkX, int chunkY, int chunkZ) {
    final int x = chunkX << Chunk.CHUNK_SIZE_BITS;
    final int z = chunkZ << Chunk.CHUNK_SIZE_BITS;
    final long seed = blockData.getWorld().getSeed();

    if (chunkY << Chunk.CHUNK_SIZE_BITS > blockData.getWorld().getHeight() - 1) {
      blockData.flood((short) 0);
      return;
    }

    for (int dx = x; dx < x + 16; ++dx) {
      for (int dz = z; dz < z + 16; ++dz) {
        biomes.getBiome(dx, dz, seed).generateColumn(blockData, dx, chunkY, dz);
      }
    }
  }
Beispiel #2
0
  @Override
  public void generateColumn(CuboidShortBuffer blockData, int x, int chunkY, int z) {
    base.setSeed((int) blockData.getWorld().getSeed());
    noise.setSeed((int) blockData.getWorld().getSeed());
    int y = chunkY * 16;
    double seaLevel = 60.0;
    double perlinRange = 0.005;
    double colSize = 16.0;
    int height =
        (int)
            ((noise.GetValue(x / colSize + perlinRange, 0.05, z / colSize + perlinRange) + 1.0)
                    * 4.0
                + seaLevel);

    for (int dy = y; dy < y + 16; dy++) {
      blockData.set(x, dy, z, getBlockId(height, dy));
    }
  }
Beispiel #3
0
  @Override
  public void generateColumn(CuboidShortBuffer blockData, int x, int chunkY, int z) {
    int y = chunkY * 16;
    noise.setSeed((int) blockData.getWorld().getSeed());

    int height =
        (int) ((noise.GetValue(x / 32.0 + 0.005, 0.05, z / 32.0 + 0.005) + 1.0) * 2.0 + 60.0 + 3.0);

    for (int dy = y; dy < y + 16; dy++) {
      short id = getBlockId(height, dy);
      blockData.set(x, dy, z, id);
    }
  }