use of net.minecraft.world.chunk.ChunkPrimer in project Cavern2 by kegare.
the class ChunkGeneratorAquaCavern 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 (AquaCavernConfig.generateCaves) {
caveGenerator.generate(world, chunkX, chunkZ, primer);
}
if (AquaCavernConfig.generateRavine) {
ravineGenerator.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 ChunkGeneratorVoid method generateChunk.
@Override
public Chunk generateChunk(int x, int z) {
Chunk chunk = new Chunk(world, new ChunkPrimer(), x, z);
byte[] biomeArray = chunk.getBiomeArray();
for (int i = 0; i < biomeArray.length; ++i) {
biomeArray[i] = (byte) Biome.getIdForBiome(Biomes.VOID);
}
chunk.resetRelightChecks();
return chunk;
}
use of net.minecraft.world.chunk.ChunkPrimer in project Cavern2 by kegare.
the class ChunkGeneratorWideDesert 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);
villageGenerator.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.DESERT);
}
chunk.generateSkylightMap();
return chunk;
}
use of net.minecraft.world.chunk.ChunkPrimer in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class ChunkProviderDestinyIslands 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);
IBlockState state;
int yOffset = 60;
for (int xPos = 0; xPos < 16; xPos++) {
for (int zPos = 0; zPos < 16; zPos++) {
int top = 15 + yOffset;
for (int depth = 1 + yOffset; depth < top; depth++) {
if (depth < 14 + yOffset)
state = Blocks.WATER.getDefaultState();
else
state = Blocks.SAND.getDefaultState();
chunkprimer.setBlockState(xPos, top - depth + yOffset, zPos, state);
}
chunkprimer.setBlockState(xPos, 0 + yOffset, zPos, Blocks.BEDROCK.getDefaultState());
}
}
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 Kingdom-Keys-Re-Coded by Wehavecookies56.
the class ChunkProviderDiveToTheHeart 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;
}
Aggregations