예제 #1
0
  @Override
  public Chunk provideChunk(int chunkX, int chunkZ) {
    rand.setSeed(chunkX * 341873128712L + chunkZ * 132897987541L);

    biomesForGeneration =
        worldObj
            .getBiomeProvider()
            .loadBlockGeneratorData(biomesForGeneration, chunkX * 16, chunkZ * 16, 16, 16);

    ChunkPrimer primer = new ChunkPrimer();

    setBlocksInChunk(primer);

    caveGenerator.generate(worldObj, chunkX, chunkZ, primer);

    if (CavelandConfig.generateRiver) {
      ravineGenerator.generate(worldObj, chunkX, chunkZ, primer);
    }

    replaceBiomeBlocks(chunkX, chunkZ, primer);

    Chunk chunk = new Chunk(worldObj, primer, chunkX, chunkZ);
    byte[] biomeArray = chunk.getBiomeArray();

    for (int i = 0; i < biomeArray.length; ++i) {
      biomeArray[i] = (byte) Biome.getIdForBiome(biomesForGeneration[i]);
    }

    chunk.resetRelightChecks();

    return chunk;
  }