if (!CommonPlugin.TIMINGS.isActive()) {
super.getChunkAt(ichunkprovider, i, j);
return;
}
Chunk chunk = this.getOrCreateChunk(i, j);
if (!chunk.done) {
chunk.done = true;
this.chunkProvider.getChunkAt(ichunkprovider, i, j);
// CraftBukkit start
BlockSand.instaFall = true;
final Random random = new Random();
random.setSeed(world.getSeed());
long xRand = random.nextLong() / 2L * 2L + 1L;
long zRand = random.nextLong() / 2L * 2L + 1L;
random.setSeed((long) i * xRand + (long) j * zRand ^ world.getSeed());
// Call populators
long time;
org.bukkit.World bWorld = getWorld();
org.bukkit.Chunk bChunk = CommonNMS.getChunk(chunk);
for (BlockPopulator populator : bWorld.getPopulators()) {
time = System.nanoTime();
try {
populator.populate(bWorld, random, bChunk);
} finally {
time = System.nanoTime() - time;
CommonPlugin.TIMINGS.onChunkPopulate(bChunk, populator, time);
}
}
// Done
BlockSand.instaFall = false;
super.world.getServer().getPluginManager().callEvent(new ChunkPopulateEvent(chunk.bukkitChunk));
// CraftBukkit end
chunk.e();
}
}