当前位置: 首页>>代码示例>>Java>>正文


Java ChunkPrimer类代码示例

本文整理汇总了Java中net.minecraft.world.chunk.ChunkPrimer的典型用法代码示例。如果您正苦于以下问题:Java ChunkPrimer类的具体用法?Java ChunkPrimer怎么用?Java ChunkPrimer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChunkPrimer类属于net.minecraft.world.chunk包,在下文中一共展示了ChunkPrimer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateBlocks

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
private void generateBlocks(ChunkPrimer primer, int chunkX, int chunkZ) {
    // TODO: replace with some actual non-superflat terrain generation
    for (int localX = 0; localX < CHUNK_SIZE; localX++) {
        for (int localZ = 0; localZ < CHUNK_SIZE; localZ++) {
            primer.setBlockState(localX, 0, localZ, BlockStates.BEDROCK);
            for (int blockY = 1; blockY < 64; blockY++) {
                IBlockState state = BlockStates.STONE;
                if (blockY == 63) {
                    state = BlockStates.GRASS;
                } else if (blockY >= 60) {
                    state = BlockStates.DIRT;
                }
                primer.setBlockState(localX, blockY, localZ, state);
            }
        }
    }
}
 
开发者ID:Boethie,项目名称:Genesis,代码行数:18,代码来源:GenesisChunkGenerator.java

示例2: genTerrainBlocks

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
    this.topBlock = Blocks.GRASS.getDefaultState();
    this.fillerBlock = Blocks.DIRT.getDefaultState();

    if ((noiseVal < -1.0D || noiseVal > 2.0D) && this.type == BiomeHills.Type.MUTATED)
    {
        this.topBlock = Blocks.GRAVEL.getDefaultState();
        this.fillerBlock = Blocks.GRAVEL.getDefaultState();
    }
    else if (noiseVal > 1.0D && this.type != BiomeHills.Type.EXTRA_TREES)
    {
        this.topBlock = Blocks.STONE.getDefaultState();
        this.fillerBlock = Blocks.STONE.getDefaultState();
    }

    this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:BiomeHills.java

示例3: generateChunk

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
/**
 * Generates the chunk at the specified position, from scratch
 */
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.replaceBiomeBlocks(x, z, chunkprimer, PontusBiomeProvider.biomeFromPosition(x, z));
    
    this.caveGenerator.generate(this.world, x, z, chunkprimer);
    this.ravineGenerator.generate(this.world, x, z, chunkprimer);

    NoodleEvent event = new NoodleEvent(this, world, x, z, chunkprimer);
    MinecraftForge.EVENT_BUS.post(event);
    chunkprimer = event.getPrimer();
    Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
    
    
    chunk.generateSkylightMap();
    return chunk;
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:24,代码来源:PontusChunkProvider.java

示例4: provideChunk

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public Chunk provideChunk(int x, int 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);
    this.setBlocksInChunk(x, z, chunkprimer);
    this.buildSurfaces(chunkprimer);

    if (this.mapFeaturesEnabled)
    {
        this.endCityGen.generate(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)Biome.getIdForBiome(this.biomesForGeneration[i]);
    }

    chunk.generateSkylightMap();
    return chunk;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ChunkProviderEnd.java

示例5: generate

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
{
    int i = this.range;
    this.worldObj = worldIn;
    this.rand.setSeed(worldIn.getSeed());
    long j = this.rand.nextLong();
    long k = this.rand.nextLong();

    for (int l = x - i; l <= x + i; ++l)
    {
        for (int i1 = z - i; i1 <= z + i; ++i1)
        {
            long j1 = (long)l * j;
            long k1 = (long)i1 * k;
            this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed());
            this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:MapGenBase.java

示例6: genTerrainBlocks

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_)
{
    this.topBlock = Blocks.grass.getDefaultState();
    this.fillerBlock = Blocks.dirt.getDefaultState();

    if (p_180622_6_ > 1.75D)
    {
        this.topBlock = Blocks.stone.getDefaultState();
        this.fillerBlock = Blocks.stone.getDefaultState();
    }
    else if (p_180622_6_ > -0.5D)
    {
        this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
    }

    this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, p_180622_4_, p_180622_5_, p_180622_6_);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:BiomeGenSavanna.java

示例7: genTerrainBlocks

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_)
{
    if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
    {
        this.topBlock = Blocks.grass.getDefaultState();
        this.fillerBlock = Blocks.dirt.getDefaultState();

        if (p_180622_6_ > 1.75D)
        {
            this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
        }
        else if (p_180622_6_ > -0.95D)
        {
            this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
        }
    }

    this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, p_180622_4_, p_180622_5_, p_180622_6_);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:BiomeGenTaiga.java

示例8: genTerrainBlocks

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_)
{
    this.topBlock = Blocks.grass.getDefaultState();
    this.fillerBlock = Blocks.dirt.getDefaultState();

    if ((p_180622_6_ < -1.0D || p_180622_6_ > 2.0D) && this.field_150638_aH == this.field_150637_aG)
    {
        this.topBlock = Blocks.gravel.getDefaultState();
        this.fillerBlock = Blocks.gravel.getDefaultState();
    }
    else if (p_180622_6_ > 1.0D && this.field_150638_aH != this.field_150636_aF)
    {
        this.topBlock = Blocks.stone.getDefaultState();
        this.fillerBlock = Blocks.stone.getDefaultState();
    }

    this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, p_180622_4_, p_180622_5_, p_180622_6_);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:BiomeGenHills.java

示例9: genTerrainBlocks

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
    this.topBlock = Blocks.GRASS.getDefaultState();
    this.fillerBlock = Blocks.DIRT.getDefaultState();

    if (noiseVal > 1.75D)
    {
        this.topBlock = Blocks.STONE.getDefaultState();
        this.fillerBlock = Blocks.STONE.getDefaultState();
    }
    else if (noiseVal > -0.5D)
    {
        this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
    }

    this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:BiomeSavannaMutated.java

示例10: digBlock

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
/**
 * Digs out the current block, default implementation removes stone, filler, and top block
 * Sets the block to lava if y is less then 10, and air other wise.
 * If setting to air, it also checks to see if we've broken the surface and if so
 * tries to make the floor the biome's top block
 *
 * @param data Block data array
 * @param index Pre-calculated index into block data
 * @param x local X position
 * @param y local Y position
 * @param z local Z position
 * @param chunkX Chunk X position
 * @param chunkZ Chunk Y position
 * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface.
 */
protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop, IBlockState state, IBlockState up)
{
    net.minecraft.world.biome.Biome biome = worldObj.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
    IBlockState top = biome.topBlock;
    IBlockState filler = biome.fillerBlock;

    if (this.canReplaceBlock(state, up) || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock())
    {
        if (y - 1 < 10)
        {
            data.setBlockState(x, y, z, BLK_LAVA);
        }
        else
        {
            data.setBlockState(x, y, z, BLK_AIR);

            if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock())
            {
                data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState());
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:39,代码来源:MapGenCaves.java

示例11: generate

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
public void generate(World worldIn, int x, int z, ChunkPrimer primer)
{
    int i = this.range;
    this.worldObj = worldIn;
    this.rand.setSeed(worldIn.getSeed());
    long j = this.rand.nextLong();
    long k = this.rand.nextLong();

    for (int l = x - i; l <= x + i; ++l)
    {
        for (int i1 = z - i; i1 <= z + i; ++i1)
        {
            long j1 = (long)l * j;
            long k1 = (long)i1 * k;
            this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed());
            this.recursiveGenerate(worldIn, l, i1, x, z, primer);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:MapGenBase.java

示例12: recursiveGenerate

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
/**
 * Recursively called by generate()
 */
protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
    if (this.rand.nextInt(50) == 0)
    {
        double d0 = (double)(chunkX * 16 + this.rand.nextInt(16));
        double d1 = (double)(this.rand.nextInt(this.rand.nextInt(40) + 8) + 20);
        double d2 = (double)(chunkZ * 16 + this.rand.nextInt(16));
        int i = 1;

        for (int j = 0; j < i; ++j)
        {
            float f = this.rand.nextFloat() * (float)Math.PI * 2.0F;
            float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
            float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F;
            this.func_180707_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2, f, f1, 0, 0, 3.0D);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:MapGenRavine.java

示例13: recursiveGenerate

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
/**
 * Recursively called by generate()
 */
protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
    if (this.rand.nextInt(50) == 0)
    {
        double d0 = (double)(chunkX * 16 + this.rand.nextInt(16));
        double d1 = (double)(this.rand.nextInt(this.rand.nextInt(40) + 8) + 20);
        double d2 = (double)(chunkZ * 16 + this.rand.nextInt(16));
        int i = 1;

        for (int j = 0; j < 1; ++j)
        {
            float f = this.rand.nextFloat() * ((float)Math.PI * 2F);
            float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
            float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F;
            this.addTunnel(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2, f, f1, 0, 0, 3.0D);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:MapGenRavine.java

示例14: provideChunk

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
/**
 * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
 * specified chunk from the map seed and chunk seed
 */
public Chunk provideChunk(int x, int z)
{
    this.endRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.func_180520_a(x, z, chunkprimer);
    this.func_180519_a(chunkprimer);
    Chunk chunk = new Chunk(this.endWorld, 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;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:23,代码来源:ChunkProviderEnd.java

示例15: digBlock

import net.minecraft.world.chunk.ChunkPrimer; //导入依赖的package包/类
/**
 * Digs out the current block, default implementation removes stone, filler, and top block
 * Sets the block to lava if y is less then 10, and air other wise.
 * If setting to air, it also checks to see if we've broken the surface and if so
 * tries to make the floor the biome's top block
 *
 * @param data Block data array
 * @param index Pre-calculated index into block data
 * @param x local X position
 * @param y local Y position
 * @param z local Z position
 * @param chunkX Chunk X position
 * @param chunkZ Chunk Y position
 * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface.
 */
protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop)
{
    net.minecraft.world.biome.Biome biome = worldObj.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
    IBlockState state = data.getBlockState(x, y, z);
    IBlockState top = isExceptionBiome(biome) ? Blocks.GRASS.getDefaultState() : biome.topBlock;
    IBlockState filler = isExceptionBiome(biome) ? Blocks.DIRT.getDefaultState() : biome.fillerBlock;

    if (state.getBlock() == Blocks.STONE || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock())
    {
        if (y - 1 < 10)
        {
            data.setBlockState(x, y, z, FLOWING_LAVA);
        }
        else
        {
            data.setBlockState(x, y, z, AIR);

            if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock())
            {
                data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState());
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:40,代码来源:MapGenRavine.java


注:本文中的net.minecraft.world.chunk.ChunkPrimer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。