本文整理汇总了Java中net.minecraft.world.WorldEntitySpawner.performWorldGenSpawning方法的典型用法代码示例。如果您正苦于以下问题:Java WorldEntitySpawner.performWorldGenSpawning方法的具体用法?Java WorldEntitySpawner.performWorldGenSpawning怎么用?Java WorldEntitySpawner.performWorldGenSpawning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.WorldEntitySpawner
的用法示例。
在下文中一共展示了WorldEntitySpawner.performWorldGenSpawning方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populate
import net.minecraft.world.WorldEntitySpawner; //导入方法依赖的package包/类
@Override
public void populate(int chunkX, int chunkZ)
{
int x = chunkX * 16;
int z = chunkZ * 16;
BlockPos pos = new BlockPos(x, 0, z);
Biome biome = this.worldObj.getBiome(pos.add(16, 0, 16));
this.rand.setSeed(this.worldObj.getSeed());
long l1 = (this.rand.nextLong() / 2L) * 2L + 1L;
long l2 = (this.rand.nextLong() / 2L) * 2L + 1L;
this.rand.setSeed((long)chunkX * l1 + (long)chunkZ * l2 ^ this.worldObj.getSeed());
biome.decorate(this.worldObj, this.rand, pos);
if (gumCount < 800)
{
++gumCount;
}
else if (this.rand.nextInt(100) == 0)
{
boolean resetCounter = false;
resetCounter = this.golden_island.generate(this.worldObj, this.rand, pos.add(this.rand.nextInt(16) + 8, this.rand.nextInt(64) + 32, this.rand.nextInt(16) + 8));
if (resetCounter)
{
gumCount = 0;
}
}
if (this.rand.nextInt(3) == 0)
{
this.dungeon_bronze.generate(this.worldObj, this.rand, pos.add(this.rand.nextInt(16), this.rand.nextInt(64) + 32, this.rand.nextInt(16)));
}
if(this.rand.nextInt(500) == 0)
{
BlockPos newPos = pos.add(this.rand.nextInt(16), this.rand.nextInt(32) + 64, this.rand.nextInt(16));
this.dungeon_silver.generate(this.worldObj, this.rand, newPos);
}
WorldEntitySpawner.performWorldGenSpawning(this.worldObj, biome, x + 8, z + 8, 16, 16, this.rand);
}
示例2: populate
import net.minecraft.world.WorldEntitySpawner; //导入方法依赖的package包/类
@Override
public void populate(int chunkX, int chunkZ) {
BlockFalling.fallInstantly = true;
int x = chunkX * 16;
int z = chunkZ * 16;
BlockPos pos = new BlockPos(x, 0, z);
Biome biome = this.world.getBiome(pos.add(16, 0, 16));
this.random.setSeed(this.world.getSeed());
long k = this.random.nextLong() / 2L * 2L + 1L;
long l = this.random.nextLong() / 2L * 2L + 1L;
this.random.setSeed((long) chunkX * k + (long) chunkZ * l ^ this.world.getSeed());
boolean generatedVillage = false;
if (this.decorate) {
ForgeEventFactory.onChunkPopulate(true, this, this.world, this.random, chunkX, chunkZ, generatedVillage);
biome.decorate(this.world, this.random, new BlockPos(x, 0, z));
if (TerrainGen.populate(this, this.world, this.random, chunkX, chunkZ, generatedVillage, PopulateChunkEvent.Populate.EventType.ANIMALS)) {
WorldEntitySpawner.performWorldGenSpawning(this.world, biome, x + 8, z + 8, 16, 16, this.random);
}
pos = pos.add(8, 0, 8);
if (TerrainGen.populate(this, this.world, this.random, chunkX, chunkZ, generatedVillage, PopulateChunkEvent.Populate.EventType.ICE)) {
for (int offsetX = 0; offsetX < 16; ++offsetX) {
for (int offsetZ = 0; offsetZ < 16; ++offsetZ) {
BlockPos snowPos = this.world.getPrecipitationHeight(pos.add(offsetX, 0, offsetZ));
BlockPos groundPos = snowPos.down();
if (this.world.canBlockFreezeWater(groundPos)) {
this.world.setBlockState(groundPos, Blocks.ICE.getDefaultState(), 2);
}
if (this.world.canSnowAt(snowPos, true)) {
this.world.setBlockState(snowPos, Blocks.SNOW_LAYER.getDefaultState(), 2);
}
}
}
}
ForgeEventFactory.onChunkPopulate(false, this, this.world, this.random, chunkX, chunkZ, generatedVillage);
}
BlockFalling.fallInstantly = false;
}