return 0;
}
SpawnLoop:
for (Map.Entry<EnumCreatureType, Integer> entry : requiredSpawns.entrySet()) {
EnumCreatureType creatureType = entry.getKey();
long hash = spawnableChunks.get(worldServer.rand.nextInt(size));
int x = (int) (hash >> 32);
int z = (int) hash;
int sX = x * 16 + worldServer.rand.nextInt(16);
int sZ = z * 16 + worldServer.rand.nextInt(16);
boolean surface = creatureType.getPeacefulCreature() || (dayTime ? surfaceChance++ % 5 == 0 : surfaceChance++ % 5 != 0);
int gap = gapChance++;
int sY;
if (creatureType == EnumCreatureType.waterCreature) {
String biomeName = worldServer.getBiomeGenForCoords(sX, sZ).biomeName;
if (!"Ocean".equals(biomeName) && !"River".equals(biomeName)) {
continue;
}
sY = getPseudoRandomHeightValue(sX, sZ, worldServer, true, gap) - 2;
} else {
sY = getPseudoRandomHeightValue(sX, sZ, worldServer, surface, gap);
}
if (sY < 0) {
continue;
}
if (worldServer.getBlockMaterial(sX, sY, sZ) == creatureType.getCreatureMaterial()) {
EntityLivingData unusedEntityLivingData = null;
for (int i = 0; i < ((clumping * 3) / 2); i++) {
int ssX = sX + (worldServer.rand.nextInt(spawnVariance) - spawnVariance / 2);
int ssZ = sZ + (worldServer.rand.nextInt(spawnVariance) - spawnVariance / 2);
int ssY;