本文整理汇总了Java中net.minecraft.world.gen.feature.WorldGenBigMushroom.generate方法的典型用法代码示例。如果您正苦于以下问题:Java WorldGenBigMushroom.generate方法的具体用法?Java WorldGenBigMushroom.generate怎么用?Java WorldGenBigMushroom.generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.gen.feature.WorldGenBigMushroom
的用法示例。
在下文中一共展示了WorldGenBigMushroom.generate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addMushrooms
import net.minecraft.world.gen.feature.WorldGenBigMushroom; //导入方法依赖的package包/类
protected void addMushrooms(World p_185379_1_, Random p_185379_2_, BlockPos p_185379_3_)
{
for (int i = 0; i < 4; ++i)
{
for (int j = 0; j < 4; ++j)
{
int k = i * 4 + 1 + 8 + p_185379_2_.nextInt(3);
int l = j * 4 + 1 + 8 + p_185379_2_.nextInt(3);
BlockPos blockpos = p_185379_1_.getHeight(p_185379_3_.add(k, 0, l));
if (p_185379_2_.nextInt(20) == 0)
{
WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
worldgenbigmushroom.generate(p_185379_1_, p_185379_2_, blockpos);
}
else
{
WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(p_185379_2_);
worldgenabstracttree.setDecorationDefaults();
if (worldgenabstracttree.generate(p_185379_1_, p_185379_2_, blockpos))
{
worldgenabstracttree.generateSaplings(p_185379_1_, p_185379_2_, blockpos);
}
}
}
}
}
示例2: addMushrooms
import net.minecraft.world.gen.feature.WorldGenBigMushroom; //导入方法依赖的package包/类
public void addMushrooms(World p_185379_1_, Random p_185379_2_, BlockPos p_185379_3_)
{
for (int i = 0; i < 4; ++i)
{
for (int j = 0; j < 4; ++j)
{
int k = i * 4 + 1 + 8 + p_185379_2_.nextInt(3);
int l = j * 4 + 1 + 8 + p_185379_2_.nextInt(3);
BlockPos blockpos = p_185379_1_.getHeight(p_185379_3_.add(k, 0, l));
if (p_185379_2_.nextInt(20) == 0 && net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM))
{
WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
worldgenbigmushroom.generate(p_185379_1_, p_185379_2_, blockpos);
}
else if (net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE))
{
WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(p_185379_2_);
worldgenabstracttree.setDecorationDefaults();
if (worldgenabstracttree.generate(p_185379_1_, p_185379_2_, blockpos))
{
worldgenabstracttree.generateSaplings(p_185379_1_, p_185379_2_, blockpos);
}
}
}
}
}
示例3: decorate
import net.minecraft.world.gen.feature.WorldGenBigMushroom; //导入方法依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
if (this.field_150632_aF == 3)
{
for (int i = 0; i < 4; ++i)
{
for (int j = 0; j < 4; ++j)
{
int k = i * 4 + 1 + 8 + rand.nextInt(3);
int l = j * 4 + 1 + 8 + rand.nextInt(3);
BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
if (rand.nextInt(20) == 0)
{
WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom();
worldgenbigmushroom.generate(worldIn, rand, blockpos);
}
else
{
WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(rand);
worldgenabstracttree.func_175904_e();
if (worldgenabstracttree.generate(worldIn, rand, blockpos))
{
worldgenabstracttree.func_180711_a(worldIn, rand, blockpos);
}
}
}
}
}
int j1 = rand.nextInt(5) - 3;
if (this.field_150632_aF == 1)
{
j1 += 2;
}
for (int k1 = 0; k1 < j1; ++k1)
{
int l1 = rand.nextInt(3);
if (l1 == 0)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SYRINGA);
}
else if (l1 == 1)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.ROSE);
}
else if (l1 == 2)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.PAEONIA);
}
for (int i2 = 0; i2 < 5; ++i2)
{
int j2 = rand.nextInt(16) + 8;
int k2 = rand.nextInt(16) + 8;
int i1 = rand.nextInt(worldIn.getHeight(pos.add(j2, 0, k2)).getY() + 32);
if (DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, new BlockPos(pos.getX() + j2, i1, pos.getZ() + k2)))
{
break;
}
}
}
super.decorate(worldIn, rand, pos);
}