Search in sources :

Example 41 with ChunkPrimer

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;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 42 with ChunkPrimer

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;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 43 with ChunkPrimer

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;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 44 with ChunkPrimer

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;
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 45 with ChunkPrimer

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;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Aggregations

ChunkPrimer (net.minecraft.world.chunk.ChunkPrimer)49 Chunk (net.minecraft.world.chunk.Chunk)38 IBlockState (net.minecraft.block.state.IBlockState)8 BlockPos (net.minecraft.util.math.BlockPos)3 Biome (net.minecraft.world.biome.Biome)3 ChunkBufferPrimer (org.spongepowered.common.util.gen.ChunkBufferPrimer)3 Nonnull (javax.annotation.Nonnull)2 ChunkPos (net.minecraft.util.math.ChunkPos)2 BOPOverworldBiome (biomesoplenty.common.biome.overworld.BOPOverworldBiome)1 Vector3i (com.flowpowered.math.vector.Vector3i)1 MapGenStructureHook (ivorius.reccomplex.world.gen.feature.structure.MapGenStructureHook)1 Random (java.util.Random)1 Nullable (javax.annotation.Nullable)1 Pair (kotlin.Pair)1 WorldProviderAsteroids (micdoodle8.mods.galacticraft.planets.asteroids.dimension.WorldProviderAsteroids)1 MutableBlockPos (net.minecraft.util.math.BlockPos.MutableBlockPos)1 ChunkCoordIntPair (net.minecraft.world.ChunkCoordIntPair)1 World (net.minecraft.world.World)1 BiomeProvider (net.minecraft.world.biome.BiomeProvider)1 ChunkGeneratorOverworld (net.minecraft.world.gen.ChunkGeneratorOverworld)1