public function generateJsonProfile($api_type)
{
$json[$api_type == self::CSL_API ? 'username' : 'player_name'] = $this->player_name;
$model = $this->getPreference();
$sec_model = $model == 'default' ? 'slim' : 'default';
if ($api_type == self::USM_API) {
$json['last_update'] = $this->getLastModified();
$json['model_preference'] = [$model, $sec_model];
}
if ($this->getTexture('steve') || $this->getTexture('alex')) {
// Skins dict order by preference model
$json['skins'][$model] = $this->getTexture($model == "default" ? "steve" : "alex");
$json['skins'][$sec_model] = $this->getTexture($sec_model == "default" ? "steve" : "alex");
}
$json['cape'] = $this->getTexture('cape');
return json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}