Search in sources :

Example 6 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project MorePlanets by SteveKunG.

the class ChunkProviderDiona method generateChunk.

@Override
public Chunk generateChunk(int chunkX, int chunkZ) {
    ChunkPrimer primer = new ChunkPrimer();
    this.rand.setSeed(chunkX * 341873128712L + chunkZ * 132897987541L);
    this.generateTerrain(chunkX, chunkZ, primer);
    this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, chunkX * 16, chunkZ * 16, 16, 16);
    this.createCraters(chunkX, chunkZ, primer);
    this.replaceBiomeBlocks(chunkX, chunkZ, primer, this.biomesForGeneration);
    this.caveGenerator.generate(this.worldObj, chunkX, chunkZ, primer);
    this.mineshaftGenerator.generate(this.worldObj, chunkX, chunkZ, primer);
    this.dungeonGenerator.generate(this.worldObj, chunkX, chunkZ, primer);
    Chunk chunk = new Chunk(this.worldObj, primer, chunkX, chunkZ);
    chunk.generateSkylightMap();
    return chunk;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 7 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project MorePlanets by SteveKunG.

the class ChunkGeneratorChalos method generateChunk.

@Override
public Chunk generateChunk(int chunkX, int chunkZ) {
    this.rand.setSeed(chunkX * 341873128712L + chunkZ * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.setBlocksInChunk(chunkX, chunkZ, chunkprimer);
    this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, chunkX * 16, chunkZ * 16, 16, 16);
    this.replaceBlocksForBiome(chunkX, chunkZ, chunkprimer, this.biomesForGeneration);
    this.caveGenerator.generate(this.worldObj, chunkX, chunkZ, chunkprimer);
    this.ravineGenerator.generate(this.worldObj, chunkX, chunkZ, chunkprimer);
    Chunk chunk = new Chunk(this.worldObj, chunkprimer, chunkX, chunkZ);
    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 8 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project SpongeCommon by SpongePowered.

the class MixinChunkGeneratorEnd method populate.

@Override
public void populate(World world, MutableBlockVolume buffer, ImmutableBiomeVolume biomes) {
    int x = GenericMath.floor(buffer.getBlockMin().getX() / 16f);
    int z = GenericMath.floor(buffer.getBlockMin().getZ() / 16f);
    ChunkPrimer chunkprimer = new ChunkBufferPrimer(buffer);
    this.rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
    this.setBlocksInChunk(x, z, chunkprimer);
}
Also used : ChunkBufferPrimer(org.spongepowered.common.util.gen.ChunkBufferPrimer) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 9 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Charset by CharsetMC.

the class ChunkGeneratorCharsetVoid method generateChunk.

@Override
public Chunk generateChunk(int x, int z) {
    ChunkPrimer primer = new ChunkPrimer();
    Chunk chunk = new Chunk(world, primer, x, z);
    byte[] biomeArray = chunk.getBiomeArray();
    byte biomeId = (byte) Biome.getIdForBiome(Biomes.FOREST);
    for (int i = 0; i < biomeArray.length; i++) {
        biomeArray[i] = biomeId;
    }
    return chunk;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 10 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Wizardry by TeamWizardry.

the class ChunkGeneratorTorikki method generateChunk.

@Nonnull
@Override
public Chunk generateChunk(int x, int z) {
    ChunkPrimer chunkprimer = new ChunkPrimer();
    generate(x, z, chunkprimer);
    Chunk chunk = new Chunk(world, chunkprimer, x, z);
    byte[] biomeArray = chunk.getBiomeArray();
    for (int i = 0; i < biomeArray.length; ++i) {
        biomeArray[i] = (byte) 42;
    }
    chunk.generateSkylightMap();
    return chunk;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer) Nonnull(javax.annotation.Nonnull)

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