Search in sources :

Example 51 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Random-Things by lumien231.

the class SpectreChunkProvider method generateChunk.

@Override
public Chunk generateChunk(int x, int z) {
    ChunkPrimer chunkprimer = new ChunkPrimer();
    Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
    chunk.resetRelightChecks();
    return chunk;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 52 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project BiomesOPlenty by Glitchfiend.

the class ChunkGeneratorOverworldBOP method generateChunk.

@Override
public Chunk generateChunk(int chunkX, int chunkZ) {
    // initialize the random generator using the chunk coordinates
    this.rand.setSeed((long) chunkX * 341873128712L + (long) chunkZ * 132897987541L);
    // create the primer
    ChunkPrimer chunkprimer = new ChunkPrimer();
    // start off by adding the basic terrain shape with air stone and water blocks
    this.setChunkAirStoneWater(chunkX, chunkZ, chunkprimer);
    // hand over to the biomes for them to set bedrock grass and dirt
    Biome[] biomes = this.world.getBiomeProvider().getBiomes(null, chunkX * 16, chunkZ * 16, 16, 16);
    this.replaceBlocksForBiome(chunkX, chunkZ, chunkprimer, biomes);
    // add structures
    if (this.settings.useCaves) {
        this.caveGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
    }
    if (this.settings.useRavines) {
        this.ravineGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
    }
    if (this.mapFeaturesEnabled) {
        if (this.settings.useMineShafts) {
            this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
        }
        if (this.settings.useVillages) {
            this.villageGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
        }
        if (this.settings.useStrongholds) {
            this.strongholdGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
        }
        if (this.settings.useTemples) {
            this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
        }
        if (this.settings.useMonuments) {
            this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
        }
        if (this.settings.useMansions) {
            this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, chunkprimer);
        }
    }
    // create and return the chunk
    Chunk chunk = new Chunk(this.world, chunkprimer, chunkX, chunkZ);
    byte[] chunkBiomes = chunk.getBiomeArray();
    for (int k = 0; k < chunkBiomes.length; ++k) {
        chunkBiomes[k] = (byte) Biome.getIdForBiome(biomes[k]);
    }
    chunk.generateSkylightMap();
    return chunk;
}
Also used : BOPOverworldBiome(biomesoplenty.common.biome.overworld.BOPOverworldBiome) Biome(net.minecraft.world.biome.Biome) Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 53 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Galacticraft by micdoodle8.

the class ChunkProviderAsteroids method generateChunk.

@Override
public Chunk generateChunk(int par1, int par2) {
    ChunkPrimer primer = new ChunkPrimer();
    // long time1 = System.nanoTime();
    this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L);
    // final Block[] ids = new Block[65536];
    // final byte[] meta = new byte[65536];
    this.generateTerrain(par1, par2, primer, false);
    if (this.world.provider instanceof WorldProviderAsteroids && ((WorldProviderAsteroids) this.world.provider).checkHasAsteroids()) {
        this.dungeonGenerator.generate(this.world, par1, par2, primer);
    }
    // long time2 = System.nanoTime();
    final Chunk var4 = new Chunk(this.world, primer, par1, par2);
    final byte[] biomesArray = var4.getBiomeArray();
    final byte b = (byte) Biome.getIdForBiome(BiomeAdaptive.biomeDefault);
    for (int i = 0; i < biomesArray.length; ++i) {
        biomesArray[i] = b;
    }
    // long time3 = System.nanoTime();
    this.generateSkylightMap(var4, par1, par2);
    // }
    return var4;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) WorldProviderAsteroids(micdoodle8.mods.galacticraft.planets.asteroids.dimension.WorldProviderAsteroids) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 54 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Galacticraft by micdoodle8.

the class ChunkProviderOrbit method generateChunk.

@Override
public Chunk generateChunk(int par1, int par2) {
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L);
    final Chunk var4 = new Chunk(this.world, chunkprimer, par1, par2);
    final byte b = (byte) Biome.getIdForBiome(BiomeAdaptive.biomeDefault);
    final byte[] biomesArray = var4.getBiomeArray();
    for (int i = 0; i < biomesArray.length; ++i) {
        biomesArray[i] = b;
    }
    var4.generateSkylightMap();
    return var4;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 55 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Galacticraft by micdoodle8.

the class ChunkProviderVenus method generateChunk.

@Override
public Chunk generateChunk(int x, int z) {
    this.rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.setBlocksInChunk(x, z, chunkprimer);
    this.biomesForGeneration = this.world.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.caveGenerator.generate(this.world, x, z, chunkprimer);
    this.lavaCaveGenerator.generate(this.world, x, z, chunkprimer);
    this.replaceBlocksForBiome(x, z, chunkprimer, this.biomesForGeneration);
    this.dungeonGenerator.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)

Aggregations

ChunkPrimer (net.minecraft.world.chunk.ChunkPrimer)55 Chunk (net.minecraft.world.chunk.Chunk)44 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 WorldProviderAsteroids (micdoodle8.mods.galacticraft.planets.asteroids.dimension.WorldProviderAsteroids)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 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