}
int cX = chunkCoordIntPair.chunkXPos;
int cZ = chunkCoordIntPair.chunkZPos;
Chunk chunk = chunkProviderServer.getChunkFastUnsafe(cX, cZ);
if (chunk == null || !chunk.isTerrainPopulated || chunk.partiallyUnloaded || chunk.queuedUnload) {
continue;
}
int xPos = cX * 16;
int zPos = cZ * 16;
this.moodSoundAndLightCheck(xPos, zPos, chunk);
chunk.updateSkylight();
int var8;
int var9;
int var10;
int var11;
if (isRaining && isThundering && provider.canDoLightning(chunk) && rand.nextInt(100000) == 0) {
updateLCG = updateLCG * 1664525 + 1013904223;
var8 = updateLCG >> 2;
var9 = xPos + (var8 & 15);
var10 = zPos + (var8 >> 8 & 15);
var11 = this.getPrecipitationHeight(var9, var10);
if (this.canLightningStrikeAt(var9, var11, var10)) {
this.addWeatherEffect(new EntityLightningBolt(this, (double) var9, (double) var11, (double) var10));
}
}
int blockID;
if (provider.canDoRainSnowIce(chunk) && rand.nextInt(16) == 0) {
updateLCG = updateLCG * 1664525 + 1013904223;
var8 = updateLCG >> 2;
var9 = var8 & 15;
var10 = var8 >> 8 & 15;
var11 = this.getPrecipitationHeight(var9 + xPos, var10 + zPos);
if (this.isBlockFreezableNaturally(var9 + xPos, var11 - 1, var10 + zPos)) {
this.setBlock(var9 + xPos, var11 - 1, var10 + zPos, Block.ice.blockID);
}
if (isRaining) {
if (this.canSnowAt(var9 + xPos, var11, var10 + zPos)) {
this.setBlock(var9 + xPos, var11, var10 + zPos, Block.snow.blockID);
}
BiomeGenBase var12 = this.getBiomeGenForCoords(var9 + xPos, var10 + zPos);
if (var12.canSpawnLightningBolt()) {
blockID = this.getBlockIdWithoutLoad(var9 + xPos, var11 - 1, var10 + zPos);
if (blockID > 0) {
Block.blocksList[blockID].fillWithRain(this, var9 + xPos, var11 - 1, var10 + zPos);
}
}
}
}
ExtendedBlockStorage[] var19 = chunk.getBlockStorageArray();
var9 = var19.length;
for (var10 = 0; var10 < var9; ++var10) {
ExtendedBlockStorage ebs = var19[var10];