while (i < 10) {
i++;
int spawnX = xCoord + worldObj.rand.nextInt(40 * 2) - 40;
int spawnY = yCoord + worldObj.rand.nextInt(40);
int spawnZ = zCoord + worldObj.rand.nextInt(40 * 2) - 40;
if (generator.generate(worldObj, worldObj.rand, spawnX, spawnY, spawnZ)) {
pendingSpawns.pop();
break;
}
}