mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-25 01:12:46 +00:00
Add offline-mode avatar source as Crafatar no longer supports names
This commit is contained in:
parent
da32ec89b2
commit
a2abd7f782
@ -183,13 +183,16 @@ class Page {
|
||||
if ($name_under) {
|
||||
$name_under = $this->settings->avatar_names_below;
|
||||
}
|
||||
$avatar_source = $this->settings->avatar_source;
|
||||
|
||||
if (strlen($uuid) === 36 && $uuid[14] === '3') {
|
||||
$avatar_source = $this->settings->avatar_source_offline_mode;
|
||||
// Avatars cannot be associated with offline mode UUIDs (version 3)
|
||||
if (!$this->settings->avatar_allow_offline_mode_uuids) {
|
||||
$uuid = $name;
|
||||
}
|
||||
}
|
||||
$src = str_replace('$NAME', $name, str_replace('$UUID', $uuid, $this->settings->avatar_source));
|
||||
$src = str_replace('$NAME', $name, str_replace('$UUID', $uuid, $avatar_source));
|
||||
if (in_array($name, $this->settings->console_aliases) || $name === $this->settings->console_name) {
|
||||
$src = $this->settings->console_image;
|
||||
$name = $this->settings->console_name;
|
||||
|
@ -55,6 +55,7 @@ final class Settings {
|
||||
* 'https://minotar.net/avatar/$NAME/25'
|
||||
*/
|
||||
$this->avatar_source = 'https://crafatar.com/avatars/$UUID?size=25';
|
||||
$this->avatar_source_offline_mode = 'https://minotar.net/avatar/$NAME/25';
|
||||
|
||||
// If enabled, names will be shown below avatars instead of being shown next to them.
|
||||
$this->avatar_names_below = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user