use of net.minecraft.world.chunk.ChunkPrimer in project Cavern2 by kegare.
the class ChunkGeneratorHugeCavern method generateChunk.
@Override
public Chunk generateChunk(int chunkX, int chunkZ) {
rand.setSeed(chunkX * 341873128712L + chunkZ * 132897987541L);
biomesForGeneration = world.getBiomeProvider().getBiomes(biomesForGeneration, chunkX * 16, chunkZ * 16, 16, 16);
ChunkPrimer primer = new ChunkPrimer();
setBlocksInChunk(primer);
if (HugeCavernConfig.generateCaves) {
caveGenerator.generate(world, chunkX, chunkZ, primer);
}
replaceBiomeBlocks(chunkX, chunkZ, primer);
veinGenerator.generate(world, rand, biomesForGeneration, primer);
Chunk chunk = new Chunk(world, primer, chunkX, chunkZ);
byte[] biomeArray = chunk.getBiomeArray();
for (int i = 0; i < biomeArray.length; ++i) {
biomeArray[i] = (byte) Biome.getIdForBiome(biomesForGeneration[i]);
}
return chunk;
}
use of net.minecraft.world.chunk.ChunkPrimer in project Cavern2 by kegare.
the class ChunkGeneratorFrostMountains method generateChunk.
@Override
public Chunk generateChunk(int x, int z) {
rand.setSeed(x * 341873128712L + z * 132897987541L);
ChunkPrimer primer = new ChunkPrimer();
setBlocksInChunk(x, z, primer);
replaceBiomeBlocks(x, z, primer);
caveGenerator.generate(world, x, z, primer);
Chunk chunk = new Chunk(this.world, primer, x, z);
byte[] biomes = chunk.getBiomeArray();
for (int i = 0; i < biomes.length; ++i) {
biomes[i] = (byte) Biome.getIdForBiome(Biomes.ICE_MOUNTAINS);
}
chunk.generateSkylightMap();
return chunk;
}
use of net.minecraft.world.chunk.ChunkPrimer in project takumicraft by TNTModders.
the class TakumiWorldChunkGenerator method generateChunk.
/**
* Generates the chunk at the specified position, from scratch
*/
@Override
public Chunk generateChunk(int x, int z) {
this.rand.setSeed((long) x * 341873128334L + (long) z * 132897987334L);
ChunkPrimer chunkprimer = new ChunkPrimer();
this.setTakumiWorldChunkGeneratorInChunk(x, z, chunkprimer);
this.biomesForGeneration = this.world.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
this.replaceBiomeTakumiWorldChunkGenerator(x, z, chunkprimer, this.biomesForGeneration);
this.caveGenerator.generate(this.world, x, z, chunkprimer);
this.ravineGenerator.generate(this.world, x, z, chunkprimer);
if (this.mapFeaturesEnabled) {
if (this.settings.useMineShafts) {
this.mineshaftGenerator.generate(this.world, x, z, chunkprimer);
}
if (this.settings.useVillages) {
this.villageGenerator.generate(this.world, x, z, chunkprimer);
}
if (this.settings.useTemples) {
this.scatteredFeatureGenerator.generate(this.world, x, z, chunkprimer);
}
}
Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
byte[] abyte = chunk.getBiomeArray();
for (int i = 0; i < abyte.length; ++i) {
abyte[i] = (byte) Biome.getIdForBiome(this.biomesForGeneration[i]);
}
chunk.generateSkylightMap();
return chunk;
}
use of net.minecraft.world.chunk.ChunkPrimer in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class ChunkProviderTraverseTown method generateChunk.
@Override
public Chunk generateChunk(int x, int z) {
this.chunkX = x;
this.chunkZ = z;
this.rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
ChunkPrimer chunkprimer = new ChunkPrimer();
this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
byte[] abyte = chunk.getBiomeArray();
for (int i = 0; i < abyte.length; ++i) {
abyte[i] = (byte) Biome.getIdForBiome(this.biomesForGeneration[i]);
}
chunk.generateSkylightMap();
return chunk;
}
use of net.minecraft.world.chunk.ChunkPrimer in project BuildCraft by BuildCraft.
the class FakeChunkProvider method provideChunk.
@Override
public Chunk provideChunk(int chunkXPos, int chunkZPos) {
ChunkCoordIntPair ccip = new ChunkCoordIntPair(chunkXPos, chunkZPos);
if (!chunks.containsKey(ccip)) {
IBlockState state = BuildCraftCore.decoratedBlock.getDefaultState();
state = state.withProperty(BuildCraftProperties.DECORATED_BLOCK, type);
ChunkPrimer primer = new ChunkPrimer();
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
primer.setBlockState(x, 0, z, state);
}
}
Chunk chunk = new Chunk(world, primer, chunkXPos, chunkZPos);
for (int i = 0; i < chunk.getBiomeArray().length; i++) {
chunk.getBiomeArray()[i] = 0;
}
chunk.generateSkylightMap();
chunks.put(ccip, chunk);
BCLog.logger.info("Created a new chunk @ " + ccip);
}
return chunks.get(ccip);
}
Aggregations