Search in sources :

Example 16 with ChunkPrimer

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

Example 17 with ChunkPrimer

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

Example 18 with ChunkPrimer

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

Example 19 with ChunkPrimer

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

Example 20 with ChunkPrimer

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