Java Code Examples for net.minecraft.world.WorldEntitySpawner#performWorldGenSpawning()

The following examples show how to use net.minecraft.world.WorldEntitySpawner#performWorldGenSpawning() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChunkProviderTofu.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
public void populate(int x, int z) {
    BlockFalling.fallInstantly = true;
    BlockPos blockpos = new BlockPos(x * 16, 0, z * 16);

    Biome biome = this.world.getBiome(blockpos.add(16, 0, 16));

    rand.setSeed(world.getSeed());
    long xSeed = rand.nextLong() / 2L * 2L + 1L;
    long zSeed = rand.nextLong() / 2L * 2L + 1L;
    rand.setSeed(chunkX * xSeed + chunkZ * zSeed ^ world.getSeed());

    int i = x * 16;
    int j = z * 16;

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


    ChunkPos chunkpos = new ChunkPos(x, z);

    if (mapFeaturesEnabled) {
        this.mineshaft.generateStructure(this.world, this.rand, chunkpos);
        this.villageGenerator.generateStructure(this.world, this.rand, chunkpos);
        this.tofuCastle.generateStructure(this.world, this.rand, chunkpos);
    }

    biome.decorate(world, rand, blockpos);


    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS))
        WorldEntitySpawner.performWorldGenSpawning(this.world, biome, 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;
}