Search in sources :

Example 36 with ChunkPrimer

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

the class ChunkProviderMoon method provideChunk.

@Override
public Chunk provideChunk(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.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.createCraters(x, z, chunkprimer);
    this.replaceBlocksForBiome(x, z, chunkprimer, this.biomesForGeneration);
    this.caveGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    this.dungeonGeneratorMoon.generate(this, this.worldObj, x, z, chunkprimer);
    this.villageGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
    byte[] abyte = chunk.getBiomeArray();
    for (int i = 0; i < abyte.length; ++i) {
        abyte[i] = (byte) this.biomesForGeneration[i].biomeID;
    }
    chunk.generateSkylightMap();
    return chunk;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 37 with ChunkPrimer

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

the class ChunkProviderOrbit method provideChunk.

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

Example 38 with ChunkPrimer

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

the class ChunkProviderSpace method provideChunk.

@Override
public Chunk provideChunk(int par1, int par2) {
    ChunkPrimer primer = new ChunkPrimer();
    try {
        this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L);
        // final Block[] ids = new Block[32768 * 2];
        // final byte[] meta = new byte[32768 * 2];
        this.generateTerrain(par1, par2, primer);
        this.createCraters(par1, par2, primer);
        this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
        this.replaceBlocksForBiome(par1, par2, primer, this.biomesForGeneration);
        if (this.worldGenerators == null) {
            this.worldGenerators = this.getWorldGenerators();
        }
        for (MapGenBaseMeta generator : this.worldGenerators) {
            generator.generate(this, this.worldObj, par1, par2, primer);
        }
        this.onChunkProvide(par1, par2, primer);
    } catch (Exception e) {
        GCLog.severe("Error caught in planetary worldgen at coords " + par1 + "," + par2 + ".  If the next 2 lines are showing an Add-On mod name, please report to that mod's author!");
        e.printStackTrace();
    }
    final Chunk var4 = new Chunk(this.worldObj, primer, par1, par2);
    final byte[] var5 = var4.getBiomeArray();
    for (int var6 = 0; var6 < var5.length; ++var6) {
        var5[var6] = (byte) this.biomesForGeneration[var6].biomeID;
    }
    var4.generateSkylightMap();
    return var4;
}
Also used : Chunk(net.minecraft.world.chunk.Chunk) ChunkPrimer(net.minecraft.world.chunk.ChunkPrimer)

Example 39 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Tropicraft by Tropicraft.

the class ChunkProviderTropicraft 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.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.replaceBiomeBlocks(x, z, chunkprimer, this.biomesForGeneration);
    this.volcanoGen.generate(x, z, chunkprimer);
    this.groveGen.generate(x, z, chunkprimer);
    this.caveGenerator.generate(this.worldObj, x, z, chunkprimer);
    this.coveGen.generate(x, z, chunkprimer);
    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 40 with ChunkPrimer

use of net.minecraft.world.chunk.ChunkPrimer in project Cavern2 by kegare.

the class ChunkGeneratorCaveland 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);
    caveGenerator.generate(world, chunkX, chunkZ, primer);
    if (CavelandConfig.generateRiver) {
        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)

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