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


Java Biome.decorate方法代码示例

本文整理汇总了Java中net.minecraft.world.biome.Biome.decorate方法的典型用法代码示例。如果您正苦于以下问题:Java Biome.decorate方法的具体用法?Java Biome.decorate怎么用?Java Biome.decorate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.biome.Biome的用法示例。


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

示例1: populate

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
/**
 * Generate initial structures in this chunk, e.g. mineshafts, temples, lakes, and dungeons
 */
public void populate(int x, int z)
{
    BlockFalling.fallInstantly = true;
    int i = x * 16;
    int j = z * 16;
    BlockPos blockpos = new BlockPos(i, 0, j);
    Biome biome = world.getBiome(blockpos.add(16, 0, 16));
    this.rand.setSeed(this.world.getSeed());
    long k = this.rand.nextLong() / 2L * 2L + 1L;
    long l = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed((long)x * k + (long)z * l ^ this.world.getSeed());
    ChunkPos chunkpos = new ChunkPos(x, z);

    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.world, this.rand, x, z, false);


    if (this.rand.nextInt(1) == 0)
    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE))
    {
        int i1 = this.rand.nextInt(16) + 8;
        int j1 = this.rand.nextInt(256);
        int k1 = this.rand.nextInt(16) + 8;
        (new WorldGenLakes(HarshenFluids.HARSHEN_DIMENSIONAL_FLUID_BLOCK)).generate(this.world, this.rand, blockpos.add(i1, j1, k1));
    }

    if (this.rand.nextInt(5) == 0)
    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA))
    {
        int i2 = this.rand.nextInt(16) + 8;
        int l2 = this.rand.nextInt(this.rand.nextInt(248) + 8);
        int k3 = this.rand.nextInt(16) + 8;

        if (l2 < this.world.getSeaLevel() || this.rand.nextInt(2) == 0)
        {
            (new WorldGenLakes(HarshenFluids.HARSHING_WATER_BLOCK)).generate(this.world, this.rand, blockpos.add(i2, l2, k3));
        }
    }
    biome.decorate(this.world, this.rand, new BlockPos(i, 0, j));
    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS))
    	{
    		performWorldGenSpawning(this.world, EnumCreatureType.CREATURE, new BlockPos(x*16, 100, z*16), i + 8, j + 8, 16, 16, this.rand);
    		performWorldGenSpawning(this.world, EnumCreatureType.MONSTER, new BlockPos(x*16, 100, z*16) , i + 8, j + 8, 16, 16, this.rand);
    	}

    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.world, this.rand, x, z, false);

    BlockFalling.fallInstantly = false;
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:52,代码来源:PontusChunkProvider.java

示例2: populate

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public void populate(int x, int z)
{
    BlockFalling.fallInstantly = true;
    int i = x * 16;
    int j = z * 16;
    BlockPos blockpos = new BlockPos(i, 0, j);
    Biome biome = this.world.getBiome(blockpos.add(16, 0, 16));
    ChunkPos chunkpos = new ChunkPos(x, z);
    this.genNetherBridge.generateStructure(this.world, this.rand, chunkpos);

    for (int k = 0; k < 8; ++k)
    {
        this.hellSpringGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(120) + 4, this.rand.nextInt(16) + 8));
    }

    for (int i1 = 0; i1 < this.rand.nextInt(this.rand.nextInt(10) + 1) + 1; ++i1)
    {
        this.fireFeature.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(120) + 4, this.rand.nextInt(16) + 8));
    }

    for (int j1 = 0; j1 < this.rand.nextInt(this.rand.nextInt(10) + 1); ++j1)
    {
        this.lightGemGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(120) + 4, this.rand.nextInt(16) + 8));
    }

    for (int k1 = 0; k1 < 10; ++k1)
    {
        this.hellPortalGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(128), this.rand.nextInt(16) + 8));
    }

    if (this.rand.nextBoolean())
    {
        this.brownMushroomFeature.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(128), this.rand.nextInt(16) + 8));
    }

    if (this.rand.nextBoolean())
    {
        this.redMushroomFeature.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(128), this.rand.nextInt(16) + 8));
    }

    for (int l1 = 0; l1 < 16; ++l1)
    {
        this.quartzGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16), this.rand.nextInt(108) + 10, this.rand.nextInt(16)));
    }

    int i2 = this.world.getSeaLevel() / 2 + 1;

    for (int l = 0; l < 4; ++l)
    {
        this.magmaGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16), i2 - 5 + this.rand.nextInt(10), this.rand.nextInt(16)));
    }

    for (int j2 = 0; j2 < 16; ++j2)
    {
        this.lavaTrapGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16), this.rand.nextInt(108) + 10, this.rand.nextInt(16)));
    }

    biome.decorate(this.world, this.rand, new BlockPos(i, 0, j));
    BlockFalling.fallInstantly = false;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:61,代码来源:ChunkProviderHell.java

示例3: populate

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public void populate(int x, int z)
{
    int i = x * 16;
    int j = z * 16;
    BlockPos blockpos = new BlockPos(i, 0, j);
    Biome biome = this.worldObj.getBiome(new BlockPos(i + 16, 0, j + 16));
    boolean flag = false;
    this.random.setSeed(this.worldObj.getSeed());
    long k = this.random.nextLong() / 2L * 2L + 1L;
    long l = this.random.nextLong() / 2L * 2L + 1L;
    this.random.setSeed((long)x * k + (long)z * l ^ this.worldObj.getSeed());
    ChunkPos chunkpos = new ChunkPos(x, z);

    for (MapGenStructure mapgenstructure : this.structureGenerators.values())
    {
        boolean flag1 = mapgenstructure.generateStructure(this.worldObj, this.random, chunkpos);

        if (mapgenstructure instanceof MapGenVillage)
        {
            flag |= flag1;
        }
    }

    if (this.waterLakeGenerator != null && !flag && this.random.nextInt(4) == 0)
    {
        this.waterLakeGenerator.generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8));
    }

    if (this.lavaLakeGenerator != null && !flag && this.random.nextInt(8) == 0)
    {
        BlockPos blockpos1 = blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(this.random.nextInt(248) + 8), this.random.nextInt(16) + 8);

        if (blockpos1.getY() < this.worldObj.getSeaLevel() || this.random.nextInt(10) == 0)
        {
            this.lavaLakeGenerator.generate(this.worldObj, this.random, blockpos1);
        }
    }

    if (this.hasDungeons)
    {
        for (int i1 = 0; i1 < 8; ++i1)
        {
            (new WorldGenDungeons()).generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8));
        }
    }

    if (this.hasDecoration)
    {
        biome.decorate(this.worldObj, this.random, blockpos);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:52,代码来源:ChunkProviderFlat.java

示例4: populate

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public void populate(int x, int z)
{
    BlockFalling.fallInstantly = true;
    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.world, this.rand, x, z, false);
    int i = x * 16;
    int j = z * 16;
    BlockPos blockpos = new BlockPos(i, 0, j);
    Biome biome = this.world.getBiome(blockpos.add(16, 0, 16));
    ChunkPos chunkpos = new ChunkPos(x, z);
    this.genNetherBridge.generateStructure(this.world, this.rand, chunkpos);

    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA))
    for (int k = 0; k < 8; ++k)
    {
        this.hellSpringGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(120) + 4, this.rand.nextInt(16) + 8));
    }

    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.FIRE))
    for (int i1 = 0; i1 < this.rand.nextInt(this.rand.nextInt(10) + 1) + 1; ++i1)
    {
        this.fireFeature.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(120) + 4, this.rand.nextInt(16) + 8));
    }

    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.GLOWSTONE))
    {
    for (int j1 = 0; j1 < this.rand.nextInt(this.rand.nextInt(10) + 1); ++j1)
    {
        this.lightGemGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(120) + 4, this.rand.nextInt(16) + 8));
    }

    for (int k1 = 0; k1 < 10; ++k1)
    {
        this.hellPortalGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(128), this.rand.nextInt(16) + 8));
    }
    }//Forge: End doGLowstone

    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.world, this.rand, x, z, false);
    net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(this.world, this.rand, blockpos));

    if (net.minecraftforge.event.terraingen.TerrainGen.decorate(this.world, this.rand, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM))
    {
    if (this.rand.nextBoolean())
    {
        this.brownMushroomFeature.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(128), this.rand.nextInt(16) + 8));
    }

    if (this.rand.nextBoolean())
    {
        this.redMushroomFeature.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(128), this.rand.nextInt(16) + 8));
    }
    }

    if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(this.world, this.rand, quartzGen, blockpos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.QUARTZ))
    for (int l1 = 0; l1 < 16; ++l1)
    {
        this.quartzGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16), this.rand.nextInt(108) + 10, this.rand.nextInt(16)));
    }

    int i2 = this.world.getSeaLevel() / 2 + 1;

    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_MAGMA))
    for (int l = 0; l < 4; ++l)
    {
        this.magmaGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16), i2 - 5 + this.rand.nextInt(10), this.rand.nextInt(16)));
    }

    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA2))
    for (int j2 = 0; j2 < 16; ++j2)
    {
        this.lavaTrapGen.generate(this.world, this.rand, blockpos.add(this.rand.nextInt(16), this.rand.nextInt(108) + 10, this.rand.nextInt(16)));
    }

    biome.decorate(this.world, this.rand, new BlockPos(i, 0, j));

    net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(this.world, this.rand, blockpos));

    BlockFalling.fallInstantly = false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:79,代码来源:ChunkProviderHell.java

示例5: populate

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public void populate(int x, int z)
{
    net.minecraft.block.BlockFalling.fallInstantly = true;
    int i = x * 16;
    int j = z * 16;
    BlockPos blockpos = new BlockPos(i, 0, j);
    Biome biome = this.worldObj.getBiome(new BlockPos(i + 16, 0, j + 16));
    boolean flag = false;
    this.random.setSeed(this.worldObj.getSeed());
    long k = this.random.nextLong() / 2L * 2L + 1L;
    long l = this.random.nextLong() / 2L * 2L + 1L;
    this.random.setSeed((long)x * k + (long)z * l ^ this.worldObj.getSeed());
    ChunkPos chunkpos = new ChunkPos(x, z);

    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.worldObj, this.random, x, z, flag);

    for (MapGenStructure mapgenstructure : this.structureGenerators)
    {
        boolean flag1 = mapgenstructure.generateStructure(this.worldObj, this.random, chunkpos);

        if (mapgenstructure instanceof MapGenVillage)
        {
            flag |= flag1;
        }
    }

    if (this.waterLakeGenerator != null && !flag && this.random.nextInt(4) == 0)
    {
        this.waterLakeGenerator.generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8));
    }

    if (this.lavaLakeGenerator != null && !flag && this.random.nextInt(8) == 0)
    {
        BlockPos blockpos1 = blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(this.random.nextInt(248) + 8), this.random.nextInt(16) + 8);

        if (blockpos1.getY() < this.worldObj.getSeaLevel() || this.random.nextInt(10) == 0)
        {
            this.lavaLakeGenerator.generate(this.worldObj, this.random, blockpos1);
        }
    }

    if (this.hasDungeons)
    {
        for (int i1 = 0; i1 < 8; ++i1)
        {
            (new WorldGenDungeons()).generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8));
        }
    }

    if (this.hasDecoration)
    {
        biome.decorate(this.worldObj, this.random, blockpos);
    }

    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.worldObj, this.random, x, z, flag);
    net.minecraft.block.BlockFalling.fallInstantly = false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:58,代码来源:ChunkProviderFlat.java


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