本文整理汇总了Java中net.minecraft.world.gen.feature.WorldGenLiquids类的典型用法代码示例。如果您正苦于以下问题:Java WorldGenLiquids类的具体用法?Java WorldGenLiquids怎么用?Java WorldGenLiquids使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WorldGenLiquids类属于net.minecraft.world.gen.feature包,在下文中一共展示了WorldGenLiquids类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: genDecorations
import net.minecraft.world.gen.feature.WorldGenLiquids; //导入依赖的package包/类
@Override
protected void genDecorations(BiomeGenBase biom)
{
this.generateOres();
int i;
int j;
int k;
i = this.treesPerChunk;
if (this.randomGenerator.nextInt(10) == 0)
{
++i;
}
int l;
int i1;
for (j = 0; j < i; ++j)
{
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = this.currentWorld.getHeightValue(k, l);
WorldGenAbstractTree worldgenabstracttree = biom.func_150567_a(this.randomGenerator);
worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l))
{
worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l);
}
}
for (j = 0; j < this.berry_per_chunk; ++j)
{
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32);
if (this.randomGenerator.nextInt(2) == 0)
this.gen_red_berry.generate(this.currentWorld, this.randomGenerator, k, i1, l);
else
this.gen_yellow_berry.generate(this.currentWorld, this.randomGenerator, k, i1, l);
}
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = 10;
while (this.currentWorld.getBlock(k, i1, l) == Blocks.air && i1 < 120)
i1++;
for (j = 0; j < this.grassPerChunk; ++j)
{
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
WorldGenerator worldgenerator = biom.getRandomWorldGenForGrass(this.randomGenerator);
worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l);
}
if (this.generateLakes)
{
for (j = 0; j < 50; ++j)
{
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8);
i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
(new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
}
for (j = 0; j < 20; ++j)
{
k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8);
i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
(new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
}
}
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
}